Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions packages/contracts/src/relay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Schema from "effect/Schema";
import * as Context from "effect/Context";
import * as Schema from "effect/Schema";
import * as HttpApi from "effect/unstable/httpapi/HttpApi";
import * as HttpApiEndpoint from "effect/unstable/httpapi/HttpApiEndpoint";
import * as HttpApiGroup from "effect/unstable/httpapi/HttpApiGroup";
Expand Down Expand Up @@ -512,26 +512,22 @@ const RelayAgentActivityPublishErrors = [
RelayInternalError,
] as const;

export interface RelayClientPrincipalShape {
readonly userId: string;
readonly token: string;
readonly proofKeyThumbprint?: string;
readonly dpopScopes?: ReadonlyArray<RelayDpopAccessTokenScope>;
}

export class RelayClientPrincipal extends Context.Service<
RelayClientPrincipal,
RelayClientPrincipalShape
{
readonly userId: string;
readonly token: string;
readonly proofKeyThumbprint?: string;
readonly dpopScopes?: ReadonlyArray<RelayDpopAccessTokenScope>;
}
>()("@t3tools/contracts/relay/RelayClientPrincipal") {}

export interface RelayEnvironmentPrincipalShape {
readonly environmentId: string;
readonly environmentPublicKey: string;
}

export class RelayEnvironmentPrincipal extends Context.Service<
RelayEnvironmentPrincipal,
RelayEnvironmentPrincipalShape
{
readonly environmentId: string;
readonly environmentPublicKey: string;
}
>()("@t3tools/contracts/relay/RelayEnvironmentPrincipal") {}

const RelayClientBearerAuthorization = HttpApiSecurity.http({ scheme: "bearer" }).pipe(
Expand Down
Loading