Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-cs committed Oct 2, 2024
1 parent 366d7c4 commit e041109
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/functions/rolePolicyFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export function generatePolicy(jwt: Jwt, logEvent: ILogEvent): APIGatewayAuthori
return undefined;
}

console.log('Role to statements');
for (const role of legacyRoles) {
console.log('Role to statements');
const items = roleToStatements(role);
statements = statements.concat(items);
}
Expand Down
4 changes: 4 additions & 0 deletions src/services/azure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ export const getCertificateChain = async (tenantId: string, keyId: string): Prom
};

const getKeys = async (tenantId: string): Promise<Map<string, string>> => {
console.log('Retrieving keys ...');
const response = await axios.get(`https://login.microsoftonline.com/${tenantId}/discovery/keys`);

const map: Map<string, string> = new Map();

const resp: KeyResponse = response.data;

console.log('Mapping ...');
for (const key of resp.keys) {
const keyId = key.kid;
const certificateChain = `-----BEGIN CERTIFICATE-----\n${key.x5c[0]}\n-----END CERTIFICATE-----`;

map.set(keyId, certificateChain);
}

console.log('Returning map ...');
return map;
};

0 comments on commit e041109

Please sign in to comment.