260 lines
7.4 KiB
Protocol Buffer
260 lines
7.4 KiB
Protocol Buffer
syntax = "proto3";
|
|||
|
|
|
||
|
|
package zitadel.user.v2beta;
|
||
|
|
|
||
|
|
option go_package = "github.com/zitadel/zitadel/pkg/grpc/user/v2beta;user";
|
||
|
|
|
||
|
|
import "google/api/field_behavior.proto";
|
||
|
|
import "google/protobuf/timestamp.proto";
|
||
|
|
import "protoc-gen-openapiv2/options/annotations.proto";
|
||
|
|
import "validate/validate.proto";
|
||
|
|
import "zitadel/object/v2beta/object.proto";
|
||
|
|
import "zitadel/user/v2beta/email.proto";
|
||
|
|
import "zitadel/user/v2beta/phone.proto";
|
||
|
|
|
||
|
|
enum Gender {
|
||
|
|
GENDER_UNSPECIFIED = 0;
|
||
|
|
GENDER_FEMALE = 1;
|
||
|
|
GENDER_MALE = 2;
|
||
|
|
GENDER_DIVERSE = 3;
|
||
|
|
}
|
||
|
|
|
||
|
|
message SetHumanProfile {
|
||
|
|
// The given name is the first name of the user
|
||
|
|
string given_name = 1 [
|
||
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||
|
|
(google.api.field_behavior) = REQUIRED,
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
min_length: 1;
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Minnie\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// The family name is the last name of the user
|
||
|
|
string family_name = 2 [
|
||
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||
|
|
(google.api.field_behavior) = REQUIRED,
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
min_length: 1;
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string nick_name = 3 [
|
||
|
|
(validate.rules).string = {max_len: 200},
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Mini\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string display_name = 4 [
|
||
|
|
(validate.rules).string = {max_len: 200},
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Minnie Mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string preferred_language = 5 [
|
||
|
|
(validate.rules).string = {max_len: 10},
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 10;
|
||
|
|
example: "\"en\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional Gender gender = 6 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"GENDER_FEMALE\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
message HumanProfile {
|
||
|
|
// The given name is the first name of the user
|
||
|
|
string given_name = 1 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
min_length: 1;
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Minnie\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// The family name is the last name of the user
|
||
|
|
string family_name = 2 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
min_length: 1;
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string nick_name = 3 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Mini\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string display_name = 4 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 200;
|
||
|
|
example: "\"Minnie Mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional string preferred_language = 5 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
max_length: 10;
|
||
|
|
example: "\"en\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
optional Gender gender = 6 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"GENDER_FEMALE\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
string avatar_url = 7 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "avatar URL of the user"
|
||
|
|
example: "\"https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
message SetMetadataEntry {
|
||
|
|
string key = 1 [
|
||
|
|
(validate.rules).string = {min_len: 1, max_len: 200},
|
||
|
|
(google.api.field_behavior) = REQUIRED,
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"my-key\"";
|
||
|
|
min_length: 1,
|
||
|
|
max_length: 200;
|
||
|
|
}
|
||
|
|
];
|
||
|
|
bytes value = 2 [
|
||
|
|
(validate.rules).bytes = {min_len: 1, max_len: 500000},
|
||
|
|
(google.api.field_behavior) = REQUIRED,
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "The value has to be base64 encoded.";
|
||
|
|
example: "\"VGhpcyBpcyBteSB0ZXN0IHZhbHVl\"";
|
||
|
|
min_length: 1,
|
||
|
|
max_length: 500000;
|
||
|
|
}
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
message HumanUser {
|
||
|
|
// Unique identifier of the user.
|
||
|
|
string user_id = 1 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"d654e6ba-70a3-48ef-a95d-37c8d8a7901a\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// State of the user, for example active, inactive, locked, deleted, initial.
|
||
|
|
UserState state = 2 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "current state of the user";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// Username of the user, which can be globally unique or unique on organization level.
|
||
|
|
string username = 3 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"minnie-mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// Possible usable login names for the user.
|
||
|
|
repeated string login_names = 4 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "[\"gigi@zitadel.com\", \"gigi@zitadel.zitadel.ch\"]";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// Preferred login name of the user.
|
||
|
|
string preferred_login_name = 5 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"gigi@zitadel.com\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
// Profile information of the user.
|
||
|
|
HumanProfile profile = 6;
|
||
|
|
// Email of the user, if defined.
|
||
|
|
HumanEmail email = 7;
|
||
|
|
// Phone of the user, if defined.
|
||
|
|
HumanPhone phone = 8;
|
||
|
|
// User is required to change the used password on the next login.
|
||
|
|
bool password_change_required = 9;
|
||
|
|
// The time the user last changed their password.
|
||
|
|
google.protobuf.Timestamp password_changed = 10;
|
||
|
|
}
|
||
|
|
|
||
|
|
message User {
|
||
|
|
string user_id = 1 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"d654e6ba-70a3-48ef-a95d-37c8d8a7901a\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
zitadel.object.v2beta.Details details = 8;
|
||
|
|
UserState state = 2 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "current state of the user";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
string username = 3 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"minnie-mouse\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
repeated string login_names = 4 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "[\"gigi@zitadel.com\", \"gigi@zitadel.zitadel.ch\"]";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
string preferred_login_name = 5 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"gigi@zitadel.com\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
oneof type {
|
||
|
|
HumanUser human = 6 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "one of type use human or machine"
|
||
|
|
}
|
||
|
|
];
|
||
|
|
MachineUser machine = 7 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "one of type use human or machine"
|
||
|
|
}
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
message MachineUser {
|
||
|
|
string name = 1 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"zitadel\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
string description = 2 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"The one and only instance\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
bool has_secret = 3 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
example: "\"true\"";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
AccessTokenType access_token_type = 4 [
|
||
|
|
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||
|
|
description: "Type of access token to receive";
|
||
|
|
}
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
enum AccessTokenType {
|
||
|
|
ACCESS_TOKEN_TYPE_BEARER = 0;
|
||
|
|
ACCESS_TOKEN_TYPE_JWT = 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
enum UserState {
|
||
|
|
USER_STATE_UNSPECIFIED = 0;
|
||
|
|
USER_STATE_ACTIVE = 1;
|
||
|
|
USER_STATE_INACTIVE = 2;
|
||
|
|
USER_STATE_DELETED = 3;
|
||
|
|
USER_STATE_LOCKED = 4;
|
||
|
|
USER_STATE_INITIAL = 5;
|
||
|
|
}
|