diff --git a/docs/app-profiles/streampixels.md b/docs/app-profiles/streampixels.md index 9d1e23d..cf7b602 100644 --- a/docs/app-profiles/streampixels.md +++ b/docs/app-profiles/streampixels.md @@ -42,7 +42,7 @@ In the service-first Heimdall version, the most likely reusable slice is: - provider OAuth authority - identity-linking authority -- managed Twitch/YouTube/Joystick credential custody for creator connections (Joystick is a managed connection only, not a viewer sign-in provider: `startOAuthFlow` admits `sign_in` and `link` only for `identityProviders` and `connect` only for `managedConnectionProviders`, and refuses anything else before any redirect) +- managed Twitch/YouTube/Joystick credential custody for creator connections (Joystick is a managed connection only, not a viewer sign-in provider: `startOAuthFlow` admits `sign_in` and `link` only for `identityProviders` and `connect` only for `managedConnectionProviders` or `identityProviders`, and refuses anything else before any redirect) - entitlement refresh - shared claim semantics diff --git a/src/app-profiles.ts b/src/app-profiles.ts index 8ac57dd..128b27a 100644 --- a/src/app-profiles.ts +++ b/src/app-profiles.ts @@ -225,13 +225,15 @@ export function serializeAppProfile(profile: AppProfile): Record { + it("sign_in and link take identityProviders only; connect takes managedConnectionProviders or identityProviders, for every profile", async () => { const app = await buildApp({ config: createTestConfig() }); try { for (const profile of Object.values(builtInAppProfiles)) { @@ -2034,7 +2034,10 @@ describe("OAuth start admits a provider by the profile's role for the mode", () url: `/v1/oauth/${provider}/start`, payload: { appSlug: profile.slug, mode, returnTo: `${profile.allowedReturnOrigins[0]}/x` }, }); - const roleList = mode === "connect" ? profile.managedConnectionProviders : profile.identityProviders; + const roleList = + mode === "connect" + ? [...profile.managedConnectionProviders, ...profile.identityProviders] + : profile.identityProviders; const refused = start.json().error === "provider_not_supported_for_app"; expect([profile.slug, provider, mode, refused]).toEqual([profile.slug, provider, mode, !roleList.includes(provider)]); }