Google is a Heimdall provider behind Bifrost, with no direct upstream. Scopes openid email profile; the callback verifies the id_token (RS256 against Google's keys, iss, aud, exp, iat, nonce) and requires a verified email. The identity key is sub, never the email. PKCE verifier and nonce are derived from the state jti and Heimdall's signing key, so nothing is stored between start and callback. Google never mints an account. mode=link needs a Heimdall access token for the app and attaches to that account only; sign_in signs in an identity already linked; an unknown sub is refused, and a sub held by another account is never moved. The six existing providers still mint on first login. Admitted to the bifrost profile only. The Idunn recipe declares the Google client id and secret file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
60 lines
1.9 KiB
TypeScript
60 lines
1.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
buildHeimdallProviderAdvertisement,
|
|
heimdallWitnessDocuments,
|
|
heimdallWitnessSchemaIds,
|
|
} from "../src/verse-witness.js";
|
|
|
|
describe("Heimdall Verse witness advertisement", () => {
|
|
it("advertises the Odin/Eve provider surface and redacted witness documents", () => {
|
|
const advertisement = buildHeimdallProviderAdvertisement({
|
|
updatedAt: "2026-06-03T12:00:00.000Z",
|
|
});
|
|
|
|
expect(advertisement).toMatchObject({
|
|
schemaVersion: "gamecult.eve.provider_advertisement.v1",
|
|
providerId: "heimdall",
|
|
verseId: "gamecult",
|
|
status: "read_only_witness_planned",
|
|
updatedAt: "2026-06-03T12:00:00.000Z",
|
|
controlSurface: {
|
|
controls: {
|
|
mode: "read-only",
|
|
writes: false,
|
|
},
|
|
},
|
|
});
|
|
expect(advertisement.providers.map((provider) => provider.key)).toEqual([
|
|
"discord",
|
|
"patreon",
|
|
"github",
|
|
"twitch",
|
|
"youtube",
|
|
"spotify",
|
|
"joystick",
|
|
"google",
|
|
]);
|
|
expect(advertisement.appProfiles.map((profile) => profile.slug)).toEqual([
|
|
"repixelizer",
|
|
"streampixels",
|
|
"bifrost",
|
|
"ghostlight",
|
|
]);
|
|
expect(advertisement.documents.map((document) => document.schemaId)).toEqual([...heimdallWitnessSchemaIds]);
|
|
});
|
|
|
|
it("keeps token custody fields forbidden in witness descriptors", () => {
|
|
expect(heimdallWitnessDocuments).toEqual(
|
|
expect.arrayContaining([
|
|
expect.objectContaining({
|
|
schemaId: "heimdall.linked_identity.v0",
|
|
forbiddenFields: expect.arrayContaining(["accessTokenEncrypted", "refreshTokenEncrypted"]),
|
|
}),
|
|
expect.objectContaining({
|
|
schemaId: "heimdall.managed_credential_projection.v0",
|
|
forbiddenFields: expect.arrayContaining(["accessToken", "refreshToken"]),
|
|
}),
|
|
])
|
|
);
|
|
});
|
|
});
|