@dt-esa/authorizer
Advanced tools
Comparing version 1.4.0 to 1.5.0
export declare type AuthenticationOptions = { | ||
mode: 'azure' | 'saml' | 'client' | 'dynatrace'; | ||
authorizations?: Map<string, Array<string>>; | ||
clientConnectionPort?: number; | ||
dynatraceEndpoint?: string; | ||
saml?: any & {}; | ||
azure?: any & {}; | ||
clientConnectionPort?: number; | ||
}; | ||
@@ -31,2 +32,3 @@ /** | ||
* clientConnectionPort?: number, // When mode is `client`, the port that the seperate webserver authorizing transactions is running on. | ||
* dynatraceEndpoint?: string // The URL that the Authorizer will check against for Dynatrace Authorization. | ||
* } | ||
@@ -33,0 +35,0 @@ * ``` |
@@ -33,4 +33,3 @@ "use strict"; | ||
const SamlStrategy = __importStar(require("passport-saml")); | ||
function getTokenPermissions(token) { | ||
const dtUrl = globalThis.config.dtUrl; | ||
function getTokenPermissions(dtUrl, token) { | ||
console.info(`Checking token permissions via ${dtUrl}api/v1/tokens/lookup/${token.replace(/\..+$/, '')}`); | ||
@@ -69,2 +68,3 @@ return axios_1.default.post(dtUrl + `api/v1/tokens/lookup`, { token }, { | ||
* clientConnectionPort?: number, // When mode is `client`, the port that the seperate webserver authorizing transactions is running on. | ||
* dynatraceEndpoint?: string // The URL that the Authorizer will check against for Dynatrace Authorization. | ||
* } | ||
@@ -197,3 +197,3 @@ * ``` | ||
else { | ||
return getTokenPermissions(token).then(({ data }) => { | ||
return getTokenPermissions(options.dynatraceEndpoint, token).then(({ data }) => { | ||
if (!data) { | ||
@@ -200,0 +200,0 @@ throw { |
{ | ||
"name": "@dt-esa/authorizer", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
17014
351