Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

466 B
Raw Blame
import { CONNECT_USER_ISSUER } from "./connect";

export function buildAppSessionAuth(
  appUserId: string,
  attributes: Record<string, string | undefined>,
) {
  const cleaned = Object.fromEntries(
    Object.entries(attributes).filter((entry): entry is [string, string] => !!entry[1]),
  );

  return {
    attributes: cleaned,
    authenticator: CONNECT_USER_ISSUER,
    issuer: CONNECT_USER_ISSUER,
    principalId: appUserId,
    principalType: "user",
  };
}