import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import Long from "long"; import { IDFilter, InIDsFilter, TextFilterMethod } from "../../filter/v2/filter.js"; export declare const protobufPackage = "zitadel.authorization.v2"; export declare enum State { STATE_UNSPECIFIED = 0, /** STATE_ACTIVE - An active authorization grants the user access with the roles specified on the project. */ STATE_ACTIVE = 1, /** * STATE_INACTIVE - An inactive authorization temporarily deactivates the granted access and roles. * ZITADEL will not include the specific authorization in any authorization information like an access token. * But the information can still be accessed using the API. */ STATE_INACTIVE = 2, UNRECOGNIZED = -1 } export declare function stateFromJSON(object: any): State; export declare function stateToJSON(object: State): string; export declare enum AuthorizationFieldName { AUTHORIZATION_FIELD_NAME_UNSPECIFIED = 0, AUTHORIZATION_FIELD_NAME_CREATED_DATE = 1, AUTHORIZATION_FIELD_NAME_CHANGED_DATE = 2, AUTHORIZATION_FIELD_NAME_ID = 3, AUTHORIZATION_FIELD_NAME_USER_ID = 4, AUTHORIZATION_FIELD_NAME_PROJECT_ID = 5, AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = 6, AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = 7, UNRECOGNIZED = -1 } export declare function authorizationFieldNameFromJSON(object: any): AuthorizationFieldName; export declare function authorizationFieldNameToJSON(object: AuthorizationFieldName): string; export interface Authorization { /** ID is the unique identifier of the authorization. */ id: string; /** CreationDate is the timestamp when the authorization was created. */ creationDate: Date | undefined; /** * ChangeDate is the timestamp when the authorization was last updated. * In case the authorization was not updated, this field is equal to the creation date. */ changeDate: Date | undefined; /** The project the user was granted the authorization for. */ project: Project | undefined; /** * The organization the user was granted the authorization for. * This does not have to correspond with the project or user's organization. * But does represent the organization to which the authorization belongs and * the user was given permissions for. */ organization: Organization | undefined; /** The user who was granted the authorization. */ user: User | undefined; /** State is the current state of the authorization. */ state: State; /** Roles contains the roles the user was granted for the project. */ roles: Role[]; } export interface Project { /** ID is the unique identifier of the project. */ id: string; /** Name is the name of the project. */ name: string; /** * OrganizationID is the ID of the organization the project belongs to. * This does not have to correspond with the authorizations organization. * In case the authorization is given on a granted project, this is the organization * that owns the project and granted it. */ organizationId: string; } export interface Organization { /** ID is the unique identifier of the organization. */ id: string; /** Name is the name of the organization. */ name: string; } export interface User { /** ID represents the ID of the user who was granted the authorization. */ id: string; /** PreferredLoginName represents the preferred login name of the granted user. */ preferredLoginName: string; /** DisplayName represents the public display name of the granted user. */ displayName: string; /** AvatarURL is the URL to the user's public avatar image. */ avatarUrl: string; /** * The organization the user belong to. * This does not have to correspond with the authorizations organization. */ organizationId: string; } export interface Role { /** * Key is the unique key of the role. It's the only relevant attribute for ZITADEL and * will be used for authorization checks and as claim in tokens and user info responses. */ key: string; /** Human readable name for the role, which might be displayed to users. */ displayName: string; /** The group the role belongs to. This is used to group roles in the UI. */ group: string; } export interface AuthorizationsSearchFilter { /** Search for authorizations by their IDs. */ authorizationIds?: InIDsFilter | undefined; /** Search for authorizations by the ID of the organization it was granted for. */ organizationId?: IDFilter | undefined; /** Search for authorizations by their state. */ state?: StateQuery | undefined; /** Search for authorizations by the IDs of the users who were granted the authorizations. */ inUserIds?: InIDsFilter | undefined; /** Search for authorizations by the ID of the organisation the user is part of. */ userOrganizationId?: IDFilter | undefined; /** Search for authorizations by the preferred login name of the granted user. */ userPreferredLoginName?: UserPreferredLoginNameQuery | undefined; /** Search for authorizations by the public display name of the granted user. */ userDisplayName?: UserDisplayNameQuery | undefined; /** * Search for authorizations by the ID of the project the user was granted the authorization for. * This will also include authorizations granted for project grants of the same project. */ projectId?: IDFilter | undefined; /** * Search for authorizations by the name of the project the user was granted the authorization for. * This will also include authorizations granted for project grants of the same project. */ projectName?: ProjectNameQuery | undefined; /** Search for authorizations by the key of the role the user was granted. */ roleKey?: RoleKeyQuery | undefined; /** * Search for authorizations by the ID of the project grant the user was granted the authorization for. * This will also include authorizations granted for project grants of the same project. */ projectGrantId?: IDFilter | undefined; } export interface StateQuery { /** Specify the state of the authorization to search for. */ state: State; } export interface UserPreferredLoginNameQuery { /** Specify the preferred login name of the granted user to search for. */ loginName: string; /** * Specify the method to search for the preferred login name. Default is EQUAL. * For example, to search for all authorizations granted to a user with * a preferred login name containing a specific string, use CONTAINS or CONTAINS_IGNORE_CASE. */ method: TextFilterMethod; } export interface UserDisplayNameQuery { /** Specify the public display name of the granted user to search for. */ displayName: string; /** * Specify the method to search for the display name. Default is EQUAL. * For example, to search for all authorizations granted to a user with * a display name containing a specific string, use CONTAINS or CONTAINS_IGNORE_CASE. */ method: TextFilterMethod; } export interface ProjectNameQuery { /** * Specify the name of the project the user was granted the authorization for to search for. * Note that this will also include authorizations granted for project grants of the same project. */ name: string; /** * Specify the method to search for the project name. Default is EQUAL. * For example, to search for all authorizations granted on a project with * a name containing a specific string, use CONTAINS or CONTAINS_IGNORE_CASE. */ method: TextFilterMethod; } export interface OrganizationNameQuery { /** * Specify the name of the organization the authorization was granted for to search for. * This can either be the organization the project or the project grant is part of. */ name: string; /** * Specify the method to search for the organization name. Default is EQUAL. * For example, to search for all authorizations with an organization name containing a specific string, * use CONTAINS or CONTAINS_IGNORE_CASE. */ method: TextFilterMethod; } export interface RoleKeyQuery { /** Specify the key of the role the user was granted to search for. */ key: string; /** * Specify the method to search for the role key. Default is EQUAL. * For example, to search for all authorizations starting with a specific role key, * use STARTS_WITH or STARTS_WITH_IGNORE_CASE. */ method: TextFilterMethod; } export declare const Authorization: MessageFns; export declare const Project: MessageFns; export declare const Organization: MessageFns; export declare const User: MessageFns; export declare const Role: MessageFns; export declare const AuthorizationsSearchFilter: MessageFns; export declare const StateQuery: MessageFns; export declare const UserPreferredLoginNameQuery: MessageFns; export declare const UserDisplayNameQuery: MessageFns; export declare const ProjectNameQuery: MessageFns; export declare const OrganizationNameQuery: MessageFns; export declare const RoleKeyQuery: MessageFns; 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 {};