backend-plugin-api: switch principal mapping to use none instead of unauthenticated

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-02-16 12:18:35 +01:00
parent 4c72edd4c0
commit ddb7060e08
3 changed files with 4 additions and 4 deletions
@@ -60,13 +60,13 @@ export class MockHttpAuthService implements HttpAuthService {
return credentials as any;
}
if (this.#auth.isPrincipal(credentials, 'unauthenticated')) {
if (this.#auth.isPrincipal(credentials, 'none')) {
if (allowedPrincipalTypes.includes('none' as TAllowed)) {
return credentials as any;
}
throw new NotAllowedError(
`This endpoint does not allow 'unauthenticated' credentials`,
`This endpoint does not allow 'none' credentials`,
);
} else if (this.#auth.isPrincipal(credentials, 'user')) {
if (allowedPrincipalTypes.includes('user' as TAllowed)) {