( token: VerifiedToken, organization: AuthorizedMcpOrganization, )
| 100 | * reads it. |
| 101 | */ |
| 102 | const principalFromToken = ( |
| 103 | token: VerifiedToken, |
| 104 | organization: AuthorizedMcpOrganization, |
| 105 | ): Principal => ({ |
| 106 | accountId: token.accountId, |
| 107 | organizationId: organization.id, |
| 108 | organizationName: organization.name, |
| 109 | ...(organization.slug === undefined ? {} : { organizationSlug: organization.slug }), |
| 110 | email: "", |
| 111 | name: null, |
| 112 | avatarUrl: null, |
| 113 | roles: [], |
| 114 | }); |
| 115 | |
| 116 | export const cloudMcpAuthProviderLayer: Layer.Layer< |
| 117 | McpAuthProvider, |