feat(module,auth): authentication module with arbitrary claims support

This commit is contained in:
2023-02-24 14:40:28 +01:00
parent 7f07e52ae0
commit 640f429580
25 changed files with 558 additions and 261 deletions

View File

@ -1,7 +1,7 @@
function testAuth(ctx) {
var subject = auth.getSubject(ctx);
var subject = auth.getClaim(ctx, auth.CLAIM_SUBJECT);
if (subject !== "jdoe") {
throw new Error("subject: expected 'jdoe', got '"+subject+"'");

View File

@ -1,9 +1,9 @@
function testAuth(ctx) {
var subject = auth.getSubject(ctx);
var subject = auth.getClaim(ctx, auth.CLAIM_SUBJECT);
if (subject !== auth.ANONYMOUS) {
throw new Error("subject: expected '"+auth.ANONYMOUS+"', got '"+subject+"'");
if (subject !== undefined) {
throw new Error("subject: expected undefined, got '"+subject+"'");
}
}