| 105 | * reads it. |
| 106 | */ |
| 107 | const principalFromToken = ( |
| 108 | token: VerifiedToken, |
| 109 | organization: AuthorizedMcpOrganization, |
| 110 | ): Principal => ({ |
| 111 | accountId: token.accountId, |
| 112 | organizationId: organization.id, |
| 113 | organizationName: organization.name, |
| 114 | ...(organization.slug === undefined ? {} : { organizationSlug: organization.slug }), |
| 115 | orgRoleModel: "organization", |
| 116 | orgRole: organization.memberRole, |
| 117 | email: "", |
| 118 | name: null, |
| 119 | avatarUrl: null, |
| 120 | roles: [], |
| 121 | }); |
| 122 | |
| 123 | export const cloudMcpAuthProviderLayer: Layer.Layer< |
| 124 | McpAuthProvider, |