import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { PaginationRequest, PaginationResponse } from "../../filter/v2beta/filter.js"; import { Authorization, AuthorizationFieldName, AuthorizationsSearchFilter } from "./authorization.js"; export declare const protobufPackage = "zitadel.authorization.v2beta"; export interface ListAuthorizationsRequest { /** Paginate through the results using a limit, offset and sorting. */ pagination?: PaginationRequest | undefined; /** The field the result is sorted by. The default is the creation date. Beware that if you change this, your result pagination might be inconsistent. */ sortingColumn?: AuthorizationFieldName | undefined; /** Define the criteria to query for. */ filters: AuthorizationsSearchFilter[]; } export interface ListAuthorizationsResponse { /** Details contains the pagination information. */ pagination: PaginationResponse | undefined; authorizations: Authorization[]; } export interface CreateAuthorizationRequest { /** UserID is the ID of the user who should be granted the authorization. */ userId: string; /** Project ID is the ID of the project the user should be authorized for. */ projectId: string; /** * OrganizationID is the ID of the organization on which the authorization should be created. * The organization must either own the project or have a grant for the project. * If omitted, the authorization is created on the projects organization. */ organizationId?: string | undefined; /** RoleKeys are the keys of the roles the user should be granted. */ roleKeys: string[]; } export interface CreateAuthorizationResponse { /** ID is the unique identifier of the newly created authorization. */ id: string; /** CreationDate is the timestamp when the authorization was created. */ creationDate: Date | undefined; } export interface UpdateAuthorizationRequest { /** ID is the unique identifier of the authorization. */ id: string; /** * RoleKeys are the keys of the roles the user should be granted. * Note that any role keys previously granted to the user and not present in the list will be revoked. */ roleKeys: string[]; } export interface UpdateAuthorizationResponse { /** ChangeDate is the timestamp when the authorization was last updated. */ changeDate: Date | undefined; } export interface DeleteAuthorizationRequest { /** ID is the unique identifier of the authorization that should be deleted. */ id: string; } export interface DeleteAuthorizationResponse { /** DeletionDate is the timestamp when the authorization was deleted. */ deletionDate: Date | undefined; } export interface ActivateAuthorizationRequest { /** ID is the unique identifier of the authorization that should be activated. */ id: string; } export interface ActivateAuthorizationResponse { /** ChangeDate is the last timestamp when the authorization was changed / activated. */ changeDate: Date | undefined; } export interface DeactivateAuthorizationRequest { /** ID is the unique identifier of the authorization that should be deactivated. */ id: string; } export interface DeactivateAuthorizationResponse { /** ChangeDate is the last timestamp when the authorization was changed / deactivated. */ changeDate: Date | undefined; } export declare const ListAuthorizationsRequest: MessageFns; export declare const ListAuthorizationsResponse: MessageFns; export declare const CreateAuthorizationRequest: MessageFns; export declare const CreateAuthorizationResponse: MessageFns; export declare const UpdateAuthorizationRequest: MessageFns; export declare const UpdateAuthorizationResponse: MessageFns; export declare const DeleteAuthorizationRequest: MessageFns; export declare const DeleteAuthorizationResponse: MessageFns; export declare const ActivateAuthorizationRequest: MessageFns; export declare const ActivateAuthorizationResponse: MessageFns; export declare const DeactivateAuthorizationRequest: MessageFns; export declare const DeactivateAuthorizationResponse: MessageFns; /** * AuthorizationService provides methods to manage authorizations for users within your projects and applications. * * For managing permissions and roles for ZITADEL internal resources, like organizations, projects, * users, etc., please use the InternalPermissionService. * * Deprecated: use authorization service v2 instead. This service will be removed in the next major version of ZITADEL. */ export type AuthorizationServiceDefinition = typeof AuthorizationServiceDefinition; export declare const AuthorizationServiceDefinition: { readonly name: "AuthorizationService"; readonly fullName: "zitadel.authorization.v2beta.AuthorizationService"; readonly methods: { /** * List Authorizations * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ListAuthorizations returns all authorizations matching the request and necessary permissions. * * Required permissions: * - "user.grant.read" * - no permissions required for listing own authorizations */ readonly listAuthorizations: { readonly name: "ListAuthorizations"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; /** * Create Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * CreateAuthorization creates a new authorization for a user in an owned or granted project. * * Required permissions: * - "user.grant.write" */ readonly createAuthorization: { readonly name: "CreateAuthorization"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; /** * Update Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * UpdateAuthorization updates the authorization. * * Note that any role keys previously granted to the user and not present in the request will be revoked. * * Required permissions: * - "user.grant.write" */ readonly updateAuthorization: { readonly name: "UpdateAuthorization"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; /** * Delete Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeleteAuthorization deletes the authorization. * * In case the authorization is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the authorization was deleted by the request. * * Required permissions: * - "user.grant.delete" */ readonly deleteAuthorization: { readonly name: "DeleteAuthorization"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; /** * Activate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ActivateAuthorization activates an existing but inactive authorization. * * In case the authorization is already active, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was activated by the request. * * Required permissions: * - "user.grant.write" */ readonly activateAuthorization: { readonly name: "ActivateAuthorization"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; /** * Deactivate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeactivateAuthorization deactivates an existing and active authorization. * * In case the authorization is already inactive, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was deactivated by the request. * * Required permissions: * - "user.grant.write" */ readonly deactivateAuthorization: { readonly name: "DeactivateAuthorization"; readonly requestType: MessageFns; readonly requestStream: false; readonly responseType: MessageFns; readonly responseStream: false; readonly options: { readonly _unknownFields: { readonly 8338: readonly [Buffer]; readonly 400010: readonly [Buffer]; readonly 578365826: readonly [Buffer]; }; }; }; }; }; export interface AuthorizationServiceImplementation { /** * List Authorizations * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ListAuthorizations returns all authorizations matching the request and necessary permissions. * * Required permissions: * - "user.grant.read" * - no permissions required for listing own authorizations */ listAuthorizations(request: ListAuthorizationsRequest, context: CallContext & CallContextExt): Promise>; /** * Create Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * CreateAuthorization creates a new authorization for a user in an owned or granted project. * * Required permissions: * - "user.grant.write" */ createAuthorization(request: CreateAuthorizationRequest, context: CallContext & CallContextExt): Promise>; /** * Update Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * UpdateAuthorization updates the authorization. * * Note that any role keys previously granted to the user and not present in the request will be revoked. * * Required permissions: * - "user.grant.write" */ updateAuthorization(request: UpdateAuthorizationRequest, context: CallContext & CallContextExt): Promise>; /** * Delete Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeleteAuthorization deletes the authorization. * * In case the authorization is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the authorization was deleted by the request. * * Required permissions: * - "user.grant.delete" */ deleteAuthorization(request: DeleteAuthorizationRequest, context: CallContext & CallContextExt): Promise>; /** * Activate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ActivateAuthorization activates an existing but inactive authorization. * * In case the authorization is already active, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was activated by the request. * * Required permissions: * - "user.grant.write" */ activateAuthorization(request: ActivateAuthorizationRequest, context: CallContext & CallContextExt): Promise>; /** * Deactivate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeactivateAuthorization deactivates an existing and active authorization. * * In case the authorization is already inactive, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was deactivated by the request. * * Required permissions: * - "user.grant.write" */ deactivateAuthorization(request: DeactivateAuthorizationRequest, context: CallContext & CallContextExt): Promise>; } export interface AuthorizationServiceClient { /** * List Authorizations * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ListAuthorizations returns all authorizations matching the request and necessary permissions. * * Required permissions: * - "user.grant.read" * - no permissions required for listing own authorizations */ listAuthorizations(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Create Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * CreateAuthorization creates a new authorization for a user in an owned or granted project. * * Required permissions: * - "user.grant.write" */ createAuthorization(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Update Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * UpdateAuthorization updates the authorization. * * Note that any role keys previously granted to the user and not present in the request will be revoked. * * Required permissions: * - "user.grant.write" */ updateAuthorization(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Delete Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeleteAuthorization deletes the authorization. * * In case the authorization is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the authorization was deleted by the request. * * Required permissions: * - "user.grant.delete" */ deleteAuthorization(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Activate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * ActivateAuthorization activates an existing but inactive authorization. * * In case the authorization is already active, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was activated by the request. * * Required permissions: * - "user.grant.write" */ activateAuthorization(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; /** * Deactivate Authorization * * Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. * * DeactivateAuthorization deactivates an existing and active authorization. * * In case the authorization is already inactive, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was deactivated by the request. * * Required permissions: * - "user.grant.write" */ deactivateAuthorization(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; export interface MessageFns { 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; fromPartial(object: DeepPartial): T; } export {};