feat(module,auth): authentication module with arbitrary claims support
This commit is contained in:
2
pkg/module/auth/testdata/auth.js
vendored
2
pkg/module/auth/testdata/auth.js
vendored
@ -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+"'");
|
||||
|
6
pkg/module/auth/testdata/auth_anonymous.js
vendored
6
pkg/module/auth/testdata/auth_anonymous.js
vendored
@ -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+"'");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user