@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
179 lines (178 loc) • 8.98 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import Long from "long";
import { type CallContext, type CallOptions } from "nice-grpc-common";
import { Details } from "../../object/v2/object.js";
import { AuthorizationError, AuthRequest, DeviceAuthorizationRequest } from "./authorization.js";
export declare const protobufPackage = "zitadel.oidc.v2";
export interface GetAuthRequestRequest {
authRequestId: string;
}
export interface GetAuthRequestResponse {
authRequest: AuthRequest | undefined;
}
export interface CreateCallbackRequest {
authRequestId: string;
session?: Session | undefined;
error?: AuthorizationError | undefined;
}
export interface Session {
sessionId: string;
sessionToken: string;
}
export interface CreateCallbackResponse {
details: Details | undefined;
callbackUrl: string;
}
export interface GetDeviceAuthorizationRequestRequest {
/** The user_code returned by the device authorization request and provided to the user by the device. */
userCode: string;
}
export interface GetDeviceAuthorizationRequestResponse {
deviceAuthorizationRequest: DeviceAuthorizationRequest | undefined;
}
export interface AuthorizeOrDenyDeviceAuthorizationRequest {
/** The device authorization id returned when submitting the user code. */
deviceAuthorizationId: string;
/** To authorize the device authorization request, the user's session must be provided. */
session?: Session | undefined;
/** Deny the device authorization request. */
deny?: Deny | undefined;
}
export interface Deny {
}
export interface AuthorizeOrDenyDeviceAuthorizationResponse {
}
export declare const GetAuthRequestRequest: MessageFns<GetAuthRequestRequest>;
export declare const GetAuthRequestResponse: MessageFns<GetAuthRequestResponse>;
export declare const CreateCallbackRequest: MessageFns<CreateCallbackRequest>;
export declare const Session: MessageFns<Session>;
export declare const CreateCallbackResponse: MessageFns<CreateCallbackResponse>;
export declare const GetDeviceAuthorizationRequestRequest: MessageFns<GetDeviceAuthorizationRequestRequest>;
export declare const GetDeviceAuthorizationRequestResponse: MessageFns<GetDeviceAuthorizationRequestResponse>;
export declare const AuthorizeOrDenyDeviceAuthorizationRequest: MessageFns<AuthorizeOrDenyDeviceAuthorizationRequest>;
export declare const Deny: MessageFns<Deny>;
export declare const AuthorizeOrDenyDeviceAuthorizationResponse: MessageFns<AuthorizeOrDenyDeviceAuthorizationResponse>;
export type OIDCServiceDefinition = typeof OIDCServiceDefinition;
export declare const OIDCServiceDefinition: {
readonly name: "OIDCService";
readonly fullName: "zitadel.oidc.v2.OIDCService";
readonly methods: {
readonly getAuthRequest: {
readonly name: "GetAuthRequest";
readonly requestType: MessageFns<GetAuthRequestRequest>;
readonly requestStream: false;
readonly responseType: MessageFns<GetAuthRequestResponse>;
readonly responseStream: false;
readonly options: {
readonly _unknownFields: {
readonly 8338: readonly [Buffer];
readonly 400010: readonly [Buffer];
readonly 578365826: readonly [Buffer];
};
};
};
readonly createCallback: {
readonly name: "CreateCallback";
readonly requestType: MessageFns<CreateCallbackRequest>;
readonly requestStream: false;
readonly responseType: MessageFns<CreateCallbackResponse>;
readonly responseStream: false;
readonly options: {
readonly _unknownFields: {
readonly 8338: readonly [Buffer];
readonly 400010: readonly [Buffer];
readonly 578365826: readonly [Buffer];
};
};
};
/**
* Get device authorization request
*
* Get the device authorization based on the provided "user code".
* This will return the device authorization request, which contains the device authorization id
* that is required to authorize the request once the user signed in or to deny it.
*/
readonly getDeviceAuthorizationRequest: {
readonly name: "GetDeviceAuthorizationRequest";
readonly requestType: MessageFns<GetDeviceAuthorizationRequestRequest>;
readonly requestStream: false;
readonly responseType: MessageFns<GetDeviceAuthorizationRequestResponse>;
readonly responseStream: false;
readonly options: {
readonly _unknownFields: {
readonly 8338: readonly [Buffer];
readonly 400010: readonly [Buffer];
readonly 578365826: readonly [Buffer];
};
};
};
/**
* Authorize or deny device authorization
*
* Authorize or deny the device authorization request based on the provided device authorization id.
*/
readonly authorizeOrDenyDeviceAuthorization: {
readonly name: "AuthorizeOrDenyDeviceAuthorization";
readonly requestType: MessageFns<AuthorizeOrDenyDeviceAuthorizationRequest>;
readonly requestStream: false;
readonly responseType: MessageFns<AuthorizeOrDenyDeviceAuthorizationResponse>;
readonly responseStream: false;
readonly options: {
readonly _unknownFields: {
readonly 8338: readonly [Buffer];
readonly 400010: readonly [Buffer];
readonly 578365826: readonly [Buffer];
};
};
};
};
};
export interface OIDCServiceImplementation<CallContextExt = {}> {
getAuthRequest(request: GetAuthRequestRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetAuthRequestResponse>>;
createCallback(request: CreateCallbackRequest, context: CallContext & CallContextExt): Promise<DeepPartial<CreateCallbackResponse>>;
/**
* Get device authorization request
*
* Get the device authorization based on the provided "user code".
* This will return the device authorization request, which contains the device authorization id
* that is required to authorize the request once the user signed in or to deny it.
*/
getDeviceAuthorizationRequest(request: GetDeviceAuthorizationRequestRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetDeviceAuthorizationRequestResponse>>;
/**
* Authorize or deny device authorization
*
* Authorize or deny the device authorization request based on the provided device authorization id.
*/
authorizeOrDenyDeviceAuthorization(request: AuthorizeOrDenyDeviceAuthorizationRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AuthorizeOrDenyDeviceAuthorizationResponse>>;
}
export interface OIDCServiceClient<CallOptionsExt = {}> {
getAuthRequest(request: DeepPartial<GetAuthRequestRequest>, options?: CallOptions & CallOptionsExt): Promise<GetAuthRequestResponse>;
createCallback(request: DeepPartial<CreateCallbackRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateCallbackResponse>;
/**
* Get device authorization request
*
* Get the device authorization based on the provided "user code".
* This will return the device authorization request, which contains the device authorization id
* that is required to authorize the request once the user signed in or to deny it.
*/
getDeviceAuthorizationRequest(request: DeepPartial<GetDeviceAuthorizationRequestRequest>, options?: CallOptions & CallOptionsExt): Promise<GetDeviceAuthorizationRequestResponse>;
/**
* Authorize or deny device authorization
*
* Authorize or deny the device authorization request based on the provided device authorization id.
*/
authorizeOrDenyDeviceAuthorization(request: DeepPartial<AuthorizeOrDenyDeviceAuthorizationRequest>, options?: CallOptions & CallOptionsExt): Promise<AuthorizeOrDenyDeviceAuthorizationResponse>;
}
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
export {};