@zitadel/node
Version:
Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.
729 lines (728 loc) • 29.2 kB
JavaScript
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.7.5
// protoc unknown
// source: zitadel/app/v2beta/oidc.proto
/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { Duration } from "../../../google/protobuf/duration.js";
import { LoginVersion } from "./login.js";
export const protobufPackage = "zitadel.app.v2beta";
export var OIDCResponseType;
(function (OIDCResponseType) {
OIDCResponseType[OIDCResponseType["OIDC_RESPONSE_TYPE_UNSPECIFIED"] = 0] = "OIDC_RESPONSE_TYPE_UNSPECIFIED";
OIDCResponseType[OIDCResponseType["OIDC_RESPONSE_TYPE_CODE"] = 1] = "OIDC_RESPONSE_TYPE_CODE";
OIDCResponseType[OIDCResponseType["OIDC_RESPONSE_TYPE_ID_TOKEN"] = 2] = "OIDC_RESPONSE_TYPE_ID_TOKEN";
OIDCResponseType[OIDCResponseType["OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN"] = 3] = "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN";
OIDCResponseType[OIDCResponseType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCResponseType || (OIDCResponseType = {}));
export function oIDCResponseTypeFromJSON(object) {
switch (object) {
case 0:
case "OIDC_RESPONSE_TYPE_UNSPECIFIED":
return OIDCResponseType.OIDC_RESPONSE_TYPE_UNSPECIFIED;
case 1:
case "OIDC_RESPONSE_TYPE_CODE":
return OIDCResponseType.OIDC_RESPONSE_TYPE_CODE;
case 2:
case "OIDC_RESPONSE_TYPE_ID_TOKEN":
return OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN;
case 3:
case "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN":
return OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN;
case -1:
case "UNRECOGNIZED":
default:
return OIDCResponseType.UNRECOGNIZED;
}
}
export function oIDCResponseTypeToJSON(object) {
switch (object) {
case OIDCResponseType.OIDC_RESPONSE_TYPE_UNSPECIFIED:
return "OIDC_RESPONSE_TYPE_UNSPECIFIED";
case OIDCResponseType.OIDC_RESPONSE_TYPE_CODE:
return "OIDC_RESPONSE_TYPE_CODE";
case OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN:
return "OIDC_RESPONSE_TYPE_ID_TOKEN";
case OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN:
return "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN";
case OIDCResponseType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var OIDCGrantType;
(function (OIDCGrantType) {
OIDCGrantType[OIDCGrantType["OIDC_GRANT_TYPE_AUTHORIZATION_CODE"] = 0] = "OIDC_GRANT_TYPE_AUTHORIZATION_CODE";
OIDCGrantType[OIDCGrantType["OIDC_GRANT_TYPE_IMPLICIT"] = 1] = "OIDC_GRANT_TYPE_IMPLICIT";
OIDCGrantType[OIDCGrantType["OIDC_GRANT_TYPE_REFRESH_TOKEN"] = 2] = "OIDC_GRANT_TYPE_REFRESH_TOKEN";
OIDCGrantType[OIDCGrantType["OIDC_GRANT_TYPE_DEVICE_CODE"] = 3] = "OIDC_GRANT_TYPE_DEVICE_CODE";
OIDCGrantType[OIDCGrantType["OIDC_GRANT_TYPE_TOKEN_EXCHANGE"] = 4] = "OIDC_GRANT_TYPE_TOKEN_EXCHANGE";
OIDCGrantType[OIDCGrantType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCGrantType || (OIDCGrantType = {}));
export function oIDCGrantTypeFromJSON(object) {
switch (object) {
case 0:
case "OIDC_GRANT_TYPE_AUTHORIZATION_CODE":
return OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE;
case 1:
case "OIDC_GRANT_TYPE_IMPLICIT":
return OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT;
case 2:
case "OIDC_GRANT_TYPE_REFRESH_TOKEN":
return OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN;
case 3:
case "OIDC_GRANT_TYPE_DEVICE_CODE":
return OIDCGrantType.OIDC_GRANT_TYPE_DEVICE_CODE;
case 4:
case "OIDC_GRANT_TYPE_TOKEN_EXCHANGE":
return OIDCGrantType.OIDC_GRANT_TYPE_TOKEN_EXCHANGE;
case -1:
case "UNRECOGNIZED":
default:
return OIDCGrantType.UNRECOGNIZED;
}
}
export function oIDCGrantTypeToJSON(object) {
switch (object) {
case OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE:
return "OIDC_GRANT_TYPE_AUTHORIZATION_CODE";
case OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT:
return "OIDC_GRANT_TYPE_IMPLICIT";
case OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN:
return "OIDC_GRANT_TYPE_REFRESH_TOKEN";
case OIDCGrantType.OIDC_GRANT_TYPE_DEVICE_CODE:
return "OIDC_GRANT_TYPE_DEVICE_CODE";
case OIDCGrantType.OIDC_GRANT_TYPE_TOKEN_EXCHANGE:
return "OIDC_GRANT_TYPE_TOKEN_EXCHANGE";
case OIDCGrantType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var OIDCAppType;
(function (OIDCAppType) {
OIDCAppType[OIDCAppType["OIDC_APP_TYPE_WEB"] = 0] = "OIDC_APP_TYPE_WEB";
OIDCAppType[OIDCAppType["OIDC_APP_TYPE_USER_AGENT"] = 1] = "OIDC_APP_TYPE_USER_AGENT";
OIDCAppType[OIDCAppType["OIDC_APP_TYPE_NATIVE"] = 2] = "OIDC_APP_TYPE_NATIVE";
OIDCAppType[OIDCAppType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCAppType || (OIDCAppType = {}));
export function oIDCAppTypeFromJSON(object) {
switch (object) {
case 0:
case "OIDC_APP_TYPE_WEB":
return OIDCAppType.OIDC_APP_TYPE_WEB;
case 1:
case "OIDC_APP_TYPE_USER_AGENT":
return OIDCAppType.OIDC_APP_TYPE_USER_AGENT;
case 2:
case "OIDC_APP_TYPE_NATIVE":
return OIDCAppType.OIDC_APP_TYPE_NATIVE;
case -1:
case "UNRECOGNIZED":
default:
return OIDCAppType.UNRECOGNIZED;
}
}
export function oIDCAppTypeToJSON(object) {
switch (object) {
case OIDCAppType.OIDC_APP_TYPE_WEB:
return "OIDC_APP_TYPE_WEB";
case OIDCAppType.OIDC_APP_TYPE_USER_AGENT:
return "OIDC_APP_TYPE_USER_AGENT";
case OIDCAppType.OIDC_APP_TYPE_NATIVE:
return "OIDC_APP_TYPE_NATIVE";
case OIDCAppType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var OIDCAuthMethodType;
(function (OIDCAuthMethodType) {
OIDCAuthMethodType[OIDCAuthMethodType["OIDC_AUTH_METHOD_TYPE_BASIC"] = 0] = "OIDC_AUTH_METHOD_TYPE_BASIC";
OIDCAuthMethodType[OIDCAuthMethodType["OIDC_AUTH_METHOD_TYPE_POST"] = 1] = "OIDC_AUTH_METHOD_TYPE_POST";
OIDCAuthMethodType[OIDCAuthMethodType["OIDC_AUTH_METHOD_TYPE_NONE"] = 2] = "OIDC_AUTH_METHOD_TYPE_NONE";
OIDCAuthMethodType[OIDCAuthMethodType["OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"] = 3] = "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT";
OIDCAuthMethodType[OIDCAuthMethodType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCAuthMethodType || (OIDCAuthMethodType = {}));
export function oIDCAuthMethodTypeFromJSON(object) {
switch (object) {
case 0:
case "OIDC_AUTH_METHOD_TYPE_BASIC":
return OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC;
case 1:
case "OIDC_AUTH_METHOD_TYPE_POST":
return OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST;
case 2:
case "OIDC_AUTH_METHOD_TYPE_NONE":
return OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE;
case 3:
case "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT":
return OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT;
case -1:
case "UNRECOGNIZED":
default:
return OIDCAuthMethodType.UNRECOGNIZED;
}
}
export function oIDCAuthMethodTypeToJSON(object) {
switch (object) {
case OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC:
return "OIDC_AUTH_METHOD_TYPE_BASIC";
case OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST:
return "OIDC_AUTH_METHOD_TYPE_POST";
case OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE:
return "OIDC_AUTH_METHOD_TYPE_NONE";
case OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT:
return "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT";
case OIDCAuthMethodType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var OIDCVersion;
(function (OIDCVersion) {
OIDCVersion[OIDCVersion["OIDC_VERSION_1_0"] = 0] = "OIDC_VERSION_1_0";
OIDCVersion[OIDCVersion["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCVersion || (OIDCVersion = {}));
export function oIDCVersionFromJSON(object) {
switch (object) {
case 0:
case "OIDC_VERSION_1_0":
return OIDCVersion.OIDC_VERSION_1_0;
case -1:
case "UNRECOGNIZED":
default:
return OIDCVersion.UNRECOGNIZED;
}
}
export function oIDCVersionToJSON(object) {
switch (object) {
case OIDCVersion.OIDC_VERSION_1_0:
return "OIDC_VERSION_1_0";
case OIDCVersion.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
export var OIDCTokenType;
(function (OIDCTokenType) {
OIDCTokenType[OIDCTokenType["OIDC_TOKEN_TYPE_BEARER"] = 0] = "OIDC_TOKEN_TYPE_BEARER";
OIDCTokenType[OIDCTokenType["OIDC_TOKEN_TYPE_JWT"] = 1] = "OIDC_TOKEN_TYPE_JWT";
OIDCTokenType[OIDCTokenType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(OIDCTokenType || (OIDCTokenType = {}));
export function oIDCTokenTypeFromJSON(object) {
switch (object) {
case 0:
case "OIDC_TOKEN_TYPE_BEARER":
return OIDCTokenType.OIDC_TOKEN_TYPE_BEARER;
case 1:
case "OIDC_TOKEN_TYPE_JWT":
return OIDCTokenType.OIDC_TOKEN_TYPE_JWT;
case -1:
case "UNRECOGNIZED":
default:
return OIDCTokenType.UNRECOGNIZED;
}
}
export function oIDCTokenTypeToJSON(object) {
switch (object) {
case OIDCTokenType.OIDC_TOKEN_TYPE_BEARER:
return "OIDC_TOKEN_TYPE_BEARER";
case OIDCTokenType.OIDC_TOKEN_TYPE_JWT:
return "OIDC_TOKEN_TYPE_JWT";
case OIDCTokenType.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
function createBaseOIDCLocalizedMessage() {
return { key: "", localizedMessage: "" };
}
export const OIDCLocalizedMessage = {
encode(message, writer = new BinaryWriter()) {
if (message.key !== "") {
writer.uint32(10).string(message.key);
}
if (message.localizedMessage !== "") {
writer.uint32(18).string(message.localizedMessage);
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOIDCLocalizedMessage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.key = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.localizedMessage = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
key: isSet(object.key) ? globalThis.String(object.key) : "",
localizedMessage: isSet(object.localizedMessage) ? globalThis.String(object.localizedMessage) : "",
};
},
toJSON(message) {
const obj = {};
if (message.key !== "") {
obj.key = message.key;
}
if (message.localizedMessage !== "") {
obj.localizedMessage = message.localizedMessage;
}
return obj;
},
create(base) {
return OIDCLocalizedMessage.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseOIDCLocalizedMessage();
message.key = object.key ?? "";
message.localizedMessage = object.localizedMessage ?? "";
return message;
},
};
function createBaseOIDCConfig() {
return {
redirectUris: [],
responseTypes: [],
grantTypes: [],
appType: 0,
clientId: "",
authMethodType: 0,
postLogoutRedirectUris: [],
version: 0,
noneCompliant: false,
complianceProblems: [],
devMode: false,
accessTokenType: 0,
accessTokenRoleAssertion: false,
idTokenRoleAssertion: false,
idTokenUserinfoAssertion: false,
clockSkew: undefined,
additionalOrigins: [],
allowedOrigins: [],
skipNativeAppSuccessPage: false,
backChannelLogoutUri: "",
loginVersion: undefined,
};
}
export const OIDCConfig = {
encode(message, writer = new BinaryWriter()) {
for (const v of message.redirectUris) {
writer.uint32(10).string(v);
}
writer.uint32(18).fork();
for (const v of message.responseTypes) {
writer.int32(v);
}
writer.join();
writer.uint32(26).fork();
for (const v of message.grantTypes) {
writer.int32(v);
}
writer.join();
if (message.appType !== 0) {
writer.uint32(32).int32(message.appType);
}
if (message.clientId !== "") {
writer.uint32(42).string(message.clientId);
}
if (message.authMethodType !== 0) {
writer.uint32(48).int32(message.authMethodType);
}
for (const v of message.postLogoutRedirectUris) {
writer.uint32(58).string(v);
}
if (message.version !== 0) {
writer.uint32(64).int32(message.version);
}
if (message.noneCompliant !== false) {
writer.uint32(72).bool(message.noneCompliant);
}
for (const v of message.complianceProblems) {
OIDCLocalizedMessage.encode(v, writer.uint32(82).fork()).join();
}
if (message.devMode !== false) {
writer.uint32(88).bool(message.devMode);
}
if (message.accessTokenType !== 0) {
writer.uint32(96).int32(message.accessTokenType);
}
if (message.accessTokenRoleAssertion !== false) {
writer.uint32(104).bool(message.accessTokenRoleAssertion);
}
if (message.idTokenRoleAssertion !== false) {
writer.uint32(112).bool(message.idTokenRoleAssertion);
}
if (message.idTokenUserinfoAssertion !== false) {
writer.uint32(120).bool(message.idTokenUserinfoAssertion);
}
if (message.clockSkew !== undefined) {
Duration.encode(message.clockSkew, writer.uint32(130).fork()).join();
}
for (const v of message.additionalOrigins) {
writer.uint32(138).string(v);
}
for (const v of message.allowedOrigins) {
writer.uint32(146).string(v);
}
if (message.skipNativeAppSuccessPage !== false) {
writer.uint32(152).bool(message.skipNativeAppSuccessPage);
}
if (message.backChannelLogoutUri !== "") {
writer.uint32(162).string(message.backChannelLogoutUri);
}
if (message.loginVersion !== undefined) {
LoginVersion.encode(message.loginVersion, writer.uint32(170).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseOIDCConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.redirectUris.push(reader.string());
continue;
}
case 2: {
if (tag === 16) {
message.responseTypes.push(reader.int32());
continue;
}
if (tag === 18) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.responseTypes.push(reader.int32());
}
continue;
}
break;
}
case 3: {
if (tag === 24) {
message.grantTypes.push(reader.int32());
continue;
}
if (tag === 26) {
const end2 = reader.uint32() + reader.pos;
while (reader.pos < end2) {
message.grantTypes.push(reader.int32());
}
continue;
}
break;
}
case 4: {
if (tag !== 32) {
break;
}
message.appType = reader.int32();
continue;
}
case 5: {
if (tag !== 42) {
break;
}
message.clientId = reader.string();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.authMethodType = reader.int32();
continue;
}
case 7: {
if (tag !== 58) {
break;
}
message.postLogoutRedirectUris.push(reader.string());
continue;
}
case 8: {
if (tag !== 64) {
break;
}
message.version = reader.int32();
continue;
}
case 9: {
if (tag !== 72) {
break;
}
message.noneCompliant = reader.bool();
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.complianceProblems.push(OIDCLocalizedMessage.decode(reader, reader.uint32()));
continue;
}
case 11: {
if (tag !== 88) {
break;
}
message.devMode = reader.bool();
continue;
}
case 12: {
if (tag !== 96) {
break;
}
message.accessTokenType = reader.int32();
continue;
}
case 13: {
if (tag !== 104) {
break;
}
message.accessTokenRoleAssertion = reader.bool();
continue;
}
case 14: {
if (tag !== 112) {
break;
}
message.idTokenRoleAssertion = reader.bool();
continue;
}
case 15: {
if (tag !== 120) {
break;
}
message.idTokenUserinfoAssertion = reader.bool();
continue;
}
case 16: {
if (tag !== 130) {
break;
}
message.clockSkew = Duration.decode(reader, reader.uint32());
continue;
}
case 17: {
if (tag !== 138) {
break;
}
message.additionalOrigins.push(reader.string());
continue;
}
case 18: {
if (tag !== 146) {
break;
}
message.allowedOrigins.push(reader.string());
continue;
}
case 19: {
if (tag !== 152) {
break;
}
message.skipNativeAppSuccessPage = reader.bool();
continue;
}
case 20: {
if (tag !== 162) {
break;
}
message.backChannelLogoutUri = reader.string();
continue;
}
case 21: {
if (tag !== 170) {
break;
}
message.loginVersion = LoginVersion.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
redirectUris: globalThis.Array.isArray(object?.redirectUris)
? object.redirectUris.map((e) => globalThis.String(e))
: [],
responseTypes: globalThis.Array.isArray(object?.responseTypes)
? object.responseTypes.map((e) => oIDCResponseTypeFromJSON(e))
: [],
grantTypes: globalThis.Array.isArray(object?.grantTypes)
? object.grantTypes.map((e) => oIDCGrantTypeFromJSON(e))
: [],
appType: isSet(object.appType) ? oIDCAppTypeFromJSON(object.appType) : 0,
clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "",
authMethodType: isSet(object.authMethodType) ? oIDCAuthMethodTypeFromJSON(object.authMethodType) : 0,
postLogoutRedirectUris: globalThis.Array.isArray(object?.postLogoutRedirectUris)
? object.postLogoutRedirectUris.map((e) => globalThis.String(e))
: [],
version: isSet(object.version) ? oIDCVersionFromJSON(object.version) : 0,
noneCompliant: isSet(object.noneCompliant) ? globalThis.Boolean(object.noneCompliant) : false,
complianceProblems: globalThis.Array.isArray(object?.complianceProblems)
? object.complianceProblems.map((e) => OIDCLocalizedMessage.fromJSON(e))
: [],
devMode: isSet(object.devMode) ? globalThis.Boolean(object.devMode) : false,
accessTokenType: isSet(object.accessTokenType) ? oIDCTokenTypeFromJSON(object.accessTokenType) : 0,
accessTokenRoleAssertion: isSet(object.accessTokenRoleAssertion)
? globalThis.Boolean(object.accessTokenRoleAssertion)
: false,
idTokenRoleAssertion: isSet(object.idTokenRoleAssertion)
? globalThis.Boolean(object.idTokenRoleAssertion)
: false,
idTokenUserinfoAssertion: isSet(object.idTokenUserinfoAssertion)
? globalThis.Boolean(object.idTokenUserinfoAssertion)
: false,
clockSkew: isSet(object.clockSkew) ? Duration.fromJSON(object.clockSkew) : undefined,
additionalOrigins: globalThis.Array.isArray(object?.additionalOrigins)
? object.additionalOrigins.map((e) => globalThis.String(e))
: [],
allowedOrigins: globalThis.Array.isArray(object?.allowedOrigins)
? object.allowedOrigins.map((e) => globalThis.String(e))
: [],
skipNativeAppSuccessPage: isSet(object.skipNativeAppSuccessPage)
? globalThis.Boolean(object.skipNativeAppSuccessPage)
: false,
backChannelLogoutUri: isSet(object.backChannelLogoutUri) ? globalThis.String(object.backChannelLogoutUri) : "",
loginVersion: isSet(object.loginVersion) ? LoginVersion.fromJSON(object.loginVersion) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.redirectUris?.length) {
obj.redirectUris = message.redirectUris;
}
if (message.responseTypes?.length) {
obj.responseTypes = message.responseTypes.map((e) => oIDCResponseTypeToJSON(e));
}
if (message.grantTypes?.length) {
obj.grantTypes = message.grantTypes.map((e) => oIDCGrantTypeToJSON(e));
}
if (message.appType !== 0) {
obj.appType = oIDCAppTypeToJSON(message.appType);
}
if (message.clientId !== "") {
obj.clientId = message.clientId;
}
if (message.authMethodType !== 0) {
obj.authMethodType = oIDCAuthMethodTypeToJSON(message.authMethodType);
}
if (message.postLogoutRedirectUris?.length) {
obj.postLogoutRedirectUris = message.postLogoutRedirectUris;
}
if (message.version !== 0) {
obj.version = oIDCVersionToJSON(message.version);
}
if (message.noneCompliant !== false) {
obj.noneCompliant = message.noneCompliant;
}
if (message.complianceProblems?.length) {
obj.complianceProblems = message.complianceProblems.map((e) => OIDCLocalizedMessage.toJSON(e));
}
if (message.devMode !== false) {
obj.devMode = message.devMode;
}
if (message.accessTokenType !== 0) {
obj.accessTokenType = oIDCTokenTypeToJSON(message.accessTokenType);
}
if (message.accessTokenRoleAssertion !== false) {
obj.accessTokenRoleAssertion = message.accessTokenRoleAssertion;
}
if (message.idTokenRoleAssertion !== false) {
obj.idTokenRoleAssertion = message.idTokenRoleAssertion;
}
if (message.idTokenUserinfoAssertion !== false) {
obj.idTokenUserinfoAssertion = message.idTokenUserinfoAssertion;
}
if (message.clockSkew !== undefined) {
obj.clockSkew = Duration.toJSON(message.clockSkew);
}
if (message.additionalOrigins?.length) {
obj.additionalOrigins = message.additionalOrigins;
}
if (message.allowedOrigins?.length) {
obj.allowedOrigins = message.allowedOrigins;
}
if (message.skipNativeAppSuccessPage !== false) {
obj.skipNativeAppSuccessPage = message.skipNativeAppSuccessPage;
}
if (message.backChannelLogoutUri !== "") {
obj.backChannelLogoutUri = message.backChannelLogoutUri;
}
if (message.loginVersion !== undefined) {
obj.loginVersion = LoginVersion.toJSON(message.loginVersion);
}
return obj;
},
create(base) {
return OIDCConfig.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseOIDCConfig();
message.redirectUris = object.redirectUris?.map((e) => e) || [];
message.responseTypes = object.responseTypes?.map((e) => e) || [];
message.grantTypes = object.grantTypes?.map((e) => e) || [];
message.appType = object.appType ?? 0;
message.clientId = object.clientId ?? "";
message.authMethodType = object.authMethodType ?? 0;
message.postLogoutRedirectUris = object.postLogoutRedirectUris?.map((e) => e) || [];
message.version = object.version ?? 0;
message.noneCompliant = object.noneCompliant ?? false;
message.complianceProblems = object.complianceProblems?.map((e) => OIDCLocalizedMessage.fromPartial(e)) || [];
message.devMode = object.devMode ?? false;
message.accessTokenType = object.accessTokenType ?? 0;
message.accessTokenRoleAssertion = object.accessTokenRoleAssertion ?? false;
message.idTokenRoleAssertion = object.idTokenRoleAssertion ?? false;
message.idTokenUserinfoAssertion = object.idTokenUserinfoAssertion ?? false;
message.clockSkew = (object.clockSkew !== undefined && object.clockSkew !== null)
? Duration.fromPartial(object.clockSkew)
: undefined;
message.additionalOrigins = object.additionalOrigins?.map((e) => e) || [];
message.allowedOrigins = object.allowedOrigins?.map((e) => e) || [];
message.skipNativeAppSuccessPage = object.skipNativeAppSuccessPage ?? false;
message.backChannelLogoutUri = object.backChannelLogoutUri ?? "";
message.loginVersion = (object.loginVersion !== undefined && object.loginVersion !== null)
? LoginVersion.fromPartial(object.loginVersion)
: undefined;
return message;
},
};
function isSet(value) {
return value !== null && value !== undefined;
}