Skip to content

Commit b72955f

Browse files
committed
docs(changeset): Update UI + Add app type in EasyAuth
1 parent f69f0e4 commit b72955f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.changeset/long-files-bathe.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@storybooker/adapter-azure": patch
3+
"@storybooker/core": patch
4+
---
5+
6+
Update UI + Add app type in EasyAuth

packages/adapter-azure/src/easy-auth.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type { AuthServiceAuthorise } from "@storybooker/core";
1212

1313
export interface EasyAuthUser extends StoryBookerUser {
1414
roles: string[] | null;
15+
type: "application" | "user";
1516
}
1617

1718
export type EasyAuthRoleMap = Map<string, Permission[]>;
@@ -24,6 +25,10 @@ const DEFAULT_AUTHORISE: AuthServiceAuthorise<EasyAuthUser> = (
2425
return false;
2526
}
2627

28+
if (user.type === "application") {
29+
return true;
30+
}
31+
2732
if (action === "read") {
2833
return true;
2934
}
@@ -64,7 +69,12 @@ export class AzureEasyAuthService implements AuthService<EasyAuthUser> {
6469

6570
const azpToken = claims.find((claim) => claim.typ === "azp")?.val;
6671
if (azpToken) {
67-
return { displayName: "Application", id: azpToken, roles: null };
72+
return {
73+
displayName: "App",
74+
id: azpToken,
75+
roles: null,
76+
type: "application",
77+
};
6878
}
6979

7080
const name = claims.find((claim) => claim.typ === "name")?.val;
@@ -83,6 +93,7 @@ export class AzureEasyAuthService implements AuthService<EasyAuthUser> {
8393
id: email || "",
8494
roles,
8595
title: roles.join(", "),
96+
type: "user",
8697
};
8798
}
8899

0 commit comments

Comments
 (0)