From 2f8c54889a4d95477b06d85b17aaa2f1b3df7d10 Mon Sep 17 00:00:00 2001 From: rig-bot Date: Wed, 24 Jan 2024 14:18:19 +0000 Subject: [PATCH] push latest version of APIs --- api/v1/authentication/service_pb.ts | 165 +++++++++++++++++++++++++++- model/auth_pb.ts | 8 ++ 2 files changed, 172 insertions(+), 1 deletion(-) diff --git a/api/v1/authentication/service_pb.ts b/api/v1/authentication/service_pb.ts index 449d35e..7ff0d05 100644 --- a/api/v1/authentication/service_pb.ts +++ b/api/v1/authentication/service_pb.ts @@ -9,6 +9,28 @@ import { ClientCredentials, Token, UserPassword } from "./user_pb.js"; import { UserIdentifier, UserInfo } from "../../../model/user_pb.js"; import { LoginType } from "../../../model/auth_pb.js"; +/** + * The type of SSO. Currently only OIDC is supported. + * + * @generated from enum api.v1.authentication.SSOType + */ +export enum SSOType { + /** + * @generated from enum value: SSO_TYPE_UNSPECIFIED = 0; + */ + SSO_TYPE_UNSPECIFIED = 0, + + /** + * @generated from enum value: SSO_TYPE_OIDC = 1; + */ + SSO_TYPE_OIDC = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(SSOType) +proto3.util.setEnumType(SSOType, "api.v1.authentication.SSOType", [ + { no: 0, name: "SSO_TYPE_UNSPECIFIED" }, + { no: 1, name: "SSO_TYPE_OIDC" }, +]); + /** * Request to verify the email of a user with a verification code sent to the email. * @@ -283,7 +305,7 @@ export class LoginResponse extends Message { } /** - * Empty logout request. The user ID etc. is taken from the token. + * Empty logout request. The user ID etc. is taken from the token. * * @generated from message api.v1.authentication.LogoutRequest */ @@ -922,6 +944,13 @@ export class GetAuthConfigResponse extends Message { */ allowsRegister = false; + /** + * SSO login options + * + * @generated from field: repeated api.v1.authentication.SSOOption sso_options = 8; + */ + ssoOptions: SSOOption[] = []; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -935,6 +964,7 @@ export class GetAuthConfigResponse extends Message { { no: 3, name: "validate_password", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 4, name: "login_types", kind: "enum", T: proto3.getEnumType(LoginType), repeated: true }, { no: 7, name: "allows_register", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 8, name: "sso_options", kind: "message", T: SSOOption, repeated: true }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): GetAuthConfigResponse { @@ -954,3 +984,136 @@ export class GetAuthConfigResponse extends Message { } } +/** + * A login option for using SSO. This might be merged into + * GetAuthConfigResponse.login_types, but is introduced as a separate field, to + * maintain backwards compatibility. + * + * @generated from message api.v1.authentication.SSOOption + */ +export class SSOOption extends Message { + /** + * Type of SSO. Currently only OIDC is supported. + * + * @generated from field: api.v1.authentication.SSOType type = 1; + */ + type = SSOType.SSO_TYPE_UNSPECIFIED; + + /** + * ID of the SSO provider as given in the platform configuration. + * + * @generated from field: string provider_id = 2; + */ + providerId = ""; + + /** + * Name of SSO provider. This is an optional human readable version of the provider ID. + * + * @generated from field: string name = 3; + */ + name = ""; + + /** + * URL of the underlying issuer. This can be used in the frontend for + * showing specific items for certain known issuers. + * + * @generated from field: string issuer_url = 4; + */ + issuerUrl = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "api.v1.authentication.SSOOption"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(SSOType) }, + { no: 2, name: "provider_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "issuer_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SSOOption { + return new SSOOption().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SSOOption { + return new SSOOption().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SSOOption { + return new SSOOption().fromJsonString(jsonString, options); + } + + static equals(a: SSOOption | PlainMessage | undefined, b: SSOOption | PlainMessage | undefined): boolean { + return proto3.util.equals(SSOOption, a, b); + } +} + +/** + * Represents an SSO provided ID of a user + * + * @generated from message api.v1.authentication.SSOID + */ +export class SSOID extends Message { + /** + * What type of SSO this ID is from + * + * @generated from field: api.v1.authentication.SSOType type = 1; + */ + type = SSOType.SSO_TYPE_UNSPECIFIED; + + /** + * The ID of the SSO provider + * + * @generated from field: string provider_id = 2; + */ + providerId = ""; + + /** + * The ID provided by SSO + * + * @generated from field: string sso_id = 3; + */ + ssoId = ""; + + /** + * The internal user ID + * + * @generated from field: string user_id = 4; + */ + userId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "api.v1.authentication.SSOID"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(SSOType) }, + { no: 2, name: "provider_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "sso_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SSOID { + return new SSOID().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SSOID { + return new SSOID().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SSOID { + return new SSOID().fromJsonString(jsonString, options); + } + + static equals(a: SSOID | PlainMessage | undefined, b: SSOID | PlainMessage | undefined): boolean { + return proto3.util.equals(SSOID, a, b); + } +} + diff --git a/model/auth_pb.ts b/model/auth_pb.ts index a72dad4..6d82921 100644 --- a/model/auth_pb.ts +++ b/model/auth_pb.ts @@ -38,6 +38,13 @@ export enum LoginType { * @generated from enum value: LOGIN_TYPE_USERNAME_PASSWORD = 3; */ USERNAME_PASSWORD = 3, + + /** + * SSO Login + * + * @generated from enum value: LOGIN_TYPE_SSO = 4; + */ + SSO = 4, } // Retrieve enum metadata with: proto3.getEnumType(LoginType) proto3.util.setEnumType(LoginType, "model.LoginType", [ @@ -45,5 +52,6 @@ proto3.util.setEnumType(LoginType, "model.LoginType", [ { no: 1, name: "LOGIN_TYPE_EMAIL_PASSWORD" }, { no: 2, name: "LOGIN_TYPE_PHONE_PASSWORD" }, { no: 3, name: "LOGIN_TYPE_USERNAME_PASSWORD" }, + { no: 4, name: "LOGIN_TYPE_SSO" }, ]);