@mcp-abap-adt/connection
Version:
ABAP connection layer for MCP ABAP ADT server
27 lines (26 loc) • 1.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.sapConfigSignature = sapConfigSignature;
function sapConfigSignature(config) {
// Include token preview (first 10 and last 10 chars) to detect token changes
// This allows connection recreation when token is updated via HTTP headers
const jwtTokenPreview = config.jwtToken
? `${config.jwtToken.substring(0, 10)}...${config.jwtToken.substring(Math.max(0, config.jwtToken.length - 10))}`
: null;
const refreshTokenPreview = config.refreshToken
? `${config.refreshToken.substring(0, 10)}...${config.refreshToken.substring(Math.max(0, config.refreshToken.length - 10))}`
: null;
const sessionCookiesPreview = config.sessionCookies
? `${config.sessionCookies.substring(0, 10)}...${config.sessionCookies.substring(Math.max(0, config.sessionCookies.length - 10))}`
: null;
return JSON.stringify({
url: config.url,
client: config.client ?? null,
authType: config.authType,
username: config.username ?? null,
password: config.password ? 'set' : null,
jwtToken: jwtTokenPreview,
refreshToken: refreshTokenPreview,
sessionCookies: sessionCookiesPreview,
});
}