diff --git a/types/defines/oidc-token.d.ts b/types/defines/oidc-token.d.ts new file mode 100644 index 00000000000..4e5b3cc41d1 --- /dev/null +++ b/types/defines/oidc-token.d.ts @@ -0,0 +1,13 @@ +/** + * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own + * identity, to exchange for cloud credentials or send to an API as a bearer + * token. Each binding has one audience, set in its config. + */ +interface OidcTokenBinding { + /** + * Returns a newly signed JWT for the configured audience, valid for 5 + * minutes. Each call gets a new `jti`. Call it when you need a token; don't + * store the token across requests. + */ + getToken(): Promise; +} diff --git a/types/generated-snapshot/experimental/index.d.ts b/types/generated-snapshot/experimental/index.d.ts index a4e786d2f70..eed04c1440c 100755 --- a/types/generated-snapshot/experimental/index.d.ts +++ b/types/generated-snapshot/experimental/index.d.ts @@ -16215,6 +16215,19 @@ declare module "cloudflare:node" { ctx?: ExecutionContext, ): Promise; } +/** + * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own + * identity, to exchange for cloud credentials or send to an API as a bearer + * token. Each binding has one audience, set in its config. + */ +interface OidcTokenBinding { + /** + * Returns a newly signed JWT for the configured audience, valid for 5 + * minutes. Each call gets a new `jti`. Call it when you need a token; don't + * store the token across requests. + */ + getToken(): Promise; +} type Params

= Record; type EventContext = { request: Request>; diff --git a/types/generated-snapshot/experimental/index.ts b/types/generated-snapshot/experimental/index.ts index cb6f2a3b8b0..72bf76d91cf 100755 --- a/types/generated-snapshot/experimental/index.ts +++ b/types/generated-snapshot/experimental/index.ts @@ -16163,6 +16163,19 @@ export declare class MessageChannel { export interface MessagePortPostMessageOptions { transfer?: any[]; } +/** + * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own + * identity, to exchange for cloud credentials or send to an API as a bearer + * token. Each binding has one audience, set in its config. + */ +export interface OidcTokenBinding { + /** + * Returns a newly signed JWT for the configured audience, valid for 5 + * minutes. Each call gets a new `jti`. Call it when you need a token; don't + * store the token across requests. + */ + getToken(): Promise; +} export type Params

= Record; export type EventContext = { request: Request>; diff --git a/types/generated-snapshot/index.d.ts b/types/generated-snapshot/index.d.ts index 5c3b5c13015..ef6b0a299cc 100755 --- a/types/generated-snapshot/index.d.ts +++ b/types/generated-snapshot/index.d.ts @@ -15847,6 +15847,19 @@ declare module "cloudflare:node" { ctx?: ExecutionContext, ): Promise; } +/** + * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own + * identity, to exchange for cloud credentials or send to an API as a bearer + * token. Each binding has one audience, set in its config. + */ +interface OidcTokenBinding { + /** + * Returns a newly signed JWT for the configured audience, valid for 5 + * minutes. Each call gets a new `jti`. Call it when you need a token; don't + * store the token across requests. + */ + getToken(): Promise; +} type Params

= Record; type EventContext = { request: Request>; diff --git a/types/generated-snapshot/index.ts b/types/generated-snapshot/index.ts index e5ad3add251..df0a9a46090 100755 --- a/types/generated-snapshot/index.ts +++ b/types/generated-snapshot/index.ts @@ -15798,6 +15798,19 @@ export declare class MessageChannel { export interface MessagePortPostMessageOptions { transfer?: any[]; } +/** + * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own + * identity, to exchange for cloud credentials or send to an API as a bearer + * token. Each binding has one audience, set in its config. + */ +export interface OidcTokenBinding { + /** + * Returns a newly signed JWT for the configured audience, valid for 5 + * minutes. Each call gets a new `jti`. Call it when you need a token; don't + * store the token across requests. + */ + getToken(): Promise; +} export type Params

= Record; export type EventContext = { request: Request>;