UNPKG

@zitadel/node

Version:

Library for API access to ZITADEL. Provides compiled gRPC service clients and helpers for applications and service accounts.

1,466 lines (1,465 loc) 49.8 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.5 // protoc unknown // source: zitadel/oidc/v2/oidc_service.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Details } from "../../object/v2/object.js"; import { AuthorizationError, AuthRequest, DeviceAuthorizationRequest } from "./authorization.js"; export const protobufPackage = "zitadel.oidc.v2"; function createBaseGetAuthRequestRequest() { return { authRequestId: "" }; } export const GetAuthRequestRequest = { encode(message, writer = new BinaryWriter()) { if (message.authRequestId !== "") { writer.uint32(10).string(message.authRequestId); } 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 = createBaseGetAuthRequestRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.authRequestId = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { authRequestId: isSet(object.authRequestId) ? globalThis.String(object.authRequestId) : "" }; }, toJSON(message) { const obj = {}; if (message.authRequestId !== "") { obj.authRequestId = message.authRequestId; } return obj; }, create(base) { return GetAuthRequestRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetAuthRequestRequest(); message.authRequestId = object.authRequestId ?? ""; return message; }, }; function createBaseGetAuthRequestResponse() { return { authRequest: undefined }; } export const GetAuthRequestResponse = { encode(message, writer = new BinaryWriter()) { if (message.authRequest !== undefined) { AuthRequest.encode(message.authRequest, writer.uint32(10).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 = createBaseGetAuthRequestResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.authRequest = AuthRequest.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { authRequest: isSet(object.authRequest) ? AuthRequest.fromJSON(object.authRequest) : undefined }; }, toJSON(message) { const obj = {}; if (message.authRequest !== undefined) { obj.authRequest = AuthRequest.toJSON(message.authRequest); } return obj; }, create(base) { return GetAuthRequestResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetAuthRequestResponse(); message.authRequest = (object.authRequest !== undefined && object.authRequest !== null) ? AuthRequest.fromPartial(object.authRequest) : undefined; return message; }, }; function createBaseCreateCallbackRequest() { return { authRequestId: "", session: undefined, error: undefined }; } export const CreateCallbackRequest = { encode(message, writer = new BinaryWriter()) { if (message.authRequestId !== "") { writer.uint32(10).string(message.authRequestId); } if (message.session !== undefined) { Session.encode(message.session, writer.uint32(18).fork()).join(); } if (message.error !== undefined) { AuthorizationError.encode(message.error, writer.uint32(26).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 = createBaseCreateCallbackRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.authRequestId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.session = Session.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.error = AuthorizationError.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { authRequestId: isSet(object.authRequestId) ? globalThis.String(object.authRequestId) : "", session: isSet(object.session) ? Session.fromJSON(object.session) : undefined, error: isSet(object.error) ? AuthorizationError.fromJSON(object.error) : undefined, }; }, toJSON(message) { const obj = {}; if (message.authRequestId !== "") { obj.authRequestId = message.authRequestId; } if (message.session !== undefined) { obj.session = Session.toJSON(message.session); } if (message.error !== undefined) { obj.error = AuthorizationError.toJSON(message.error); } return obj; }, create(base) { return CreateCallbackRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateCallbackRequest(); message.authRequestId = object.authRequestId ?? ""; message.session = (object.session !== undefined && object.session !== null) ? Session.fromPartial(object.session) : undefined; message.error = (object.error !== undefined && object.error !== null) ? AuthorizationError.fromPartial(object.error) : undefined; return message; }, }; function createBaseSession() { return { sessionId: "", sessionToken: "" }; } export const Session = { encode(message, writer = new BinaryWriter()) { if (message.sessionId !== "") { writer.uint32(10).string(message.sessionId); } if (message.sessionToken !== "") { writer.uint32(18).string(message.sessionToken); } 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 = createBaseSession(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.sessionId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.sessionToken = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { sessionId: isSet(object.sessionId) ? globalThis.String(object.sessionId) : "", sessionToken: isSet(object.sessionToken) ? globalThis.String(object.sessionToken) : "", }; }, toJSON(message) { const obj = {}; if (message.sessionId !== "") { obj.sessionId = message.sessionId; } if (message.sessionToken !== "") { obj.sessionToken = message.sessionToken; } return obj; }, create(base) { return Session.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseSession(); message.sessionId = object.sessionId ?? ""; message.sessionToken = object.sessionToken ?? ""; return message; }, }; function createBaseCreateCallbackResponse() { return { details: undefined, callbackUrl: "" }; } export const CreateCallbackResponse = { encode(message, writer = new BinaryWriter()) { if (message.details !== undefined) { Details.encode(message.details, writer.uint32(10).fork()).join(); } if (message.callbackUrl !== "") { writer.uint32(18).string(message.callbackUrl); } 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 = createBaseCreateCallbackResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.details = Details.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.callbackUrl = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { details: isSet(object.details) ? Details.fromJSON(object.details) : undefined, callbackUrl: isSet(object.callbackUrl) ? globalThis.String(object.callbackUrl) : "", }; }, toJSON(message) { const obj = {}; if (message.details !== undefined) { obj.details = Details.toJSON(message.details); } if (message.callbackUrl !== "") { obj.callbackUrl = message.callbackUrl; } return obj; }, create(base) { return CreateCallbackResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateCallbackResponse(); message.details = (object.details !== undefined && object.details !== null) ? Details.fromPartial(object.details) : undefined; message.callbackUrl = object.callbackUrl ?? ""; return message; }, }; function createBaseGetDeviceAuthorizationRequestRequest() { return { userCode: "" }; } export const GetDeviceAuthorizationRequestRequest = { encode(message, writer = new BinaryWriter()) { if (message.userCode !== "") { writer.uint32(10).string(message.userCode); } 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 = createBaseGetDeviceAuthorizationRequestRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.userCode = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { userCode: isSet(object.userCode) ? globalThis.String(object.userCode) : "" }; }, toJSON(message) { const obj = {}; if (message.userCode !== "") { obj.userCode = message.userCode; } return obj; }, create(base) { return GetDeviceAuthorizationRequestRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetDeviceAuthorizationRequestRequest(); message.userCode = object.userCode ?? ""; return message; }, }; function createBaseGetDeviceAuthorizationRequestResponse() { return { deviceAuthorizationRequest: undefined }; } export const GetDeviceAuthorizationRequestResponse = { encode(message, writer = new BinaryWriter()) { if (message.deviceAuthorizationRequest !== undefined) { DeviceAuthorizationRequest.encode(message.deviceAuthorizationRequest, writer.uint32(10).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 = createBaseGetDeviceAuthorizationRequestResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.deviceAuthorizationRequest = DeviceAuthorizationRequest.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { deviceAuthorizationRequest: isSet(object.deviceAuthorizationRequest) ? DeviceAuthorizationRequest.fromJSON(object.deviceAuthorizationRequest) : undefined, }; }, toJSON(message) { const obj = {}; if (message.deviceAuthorizationRequest !== undefined) { obj.deviceAuthorizationRequest = DeviceAuthorizationRequest.toJSON(message.deviceAuthorizationRequest); } return obj; }, create(base) { return GetDeviceAuthorizationRequestResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetDeviceAuthorizationRequestResponse(); message.deviceAuthorizationRequest = (object.deviceAuthorizationRequest !== undefined && object.deviceAuthorizationRequest !== null) ? DeviceAuthorizationRequest.fromPartial(object.deviceAuthorizationRequest) : undefined; return message; }, }; function createBaseAuthorizeOrDenyDeviceAuthorizationRequest() { return { deviceAuthorizationId: "", session: undefined, deny: undefined }; } export const AuthorizeOrDenyDeviceAuthorizationRequest = { encode(message, writer = new BinaryWriter()) { if (message.deviceAuthorizationId !== "") { writer.uint32(10).string(message.deviceAuthorizationId); } if (message.session !== undefined) { Session.encode(message.session, writer.uint32(18).fork()).join(); } if (message.deny !== undefined) { Deny.encode(message.deny, writer.uint32(26).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 = createBaseAuthorizeOrDenyDeviceAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.deviceAuthorizationId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.session = Session.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.deny = Deny.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { deviceAuthorizationId: isSet(object.deviceAuthorizationId) ? globalThis.String(object.deviceAuthorizationId) : "", session: isSet(object.session) ? Session.fromJSON(object.session) : undefined, deny: isSet(object.deny) ? Deny.fromJSON(object.deny) : undefined, }; }, toJSON(message) { const obj = {}; if (message.deviceAuthorizationId !== "") { obj.deviceAuthorizationId = message.deviceAuthorizationId; } if (message.session !== undefined) { obj.session = Session.toJSON(message.session); } if (message.deny !== undefined) { obj.deny = Deny.toJSON(message.deny); } return obj; }, create(base) { return AuthorizeOrDenyDeviceAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseAuthorizeOrDenyDeviceAuthorizationRequest(); message.deviceAuthorizationId = object.deviceAuthorizationId ?? ""; message.session = (object.session !== undefined && object.session !== null) ? Session.fromPartial(object.session) : undefined; message.deny = (object.deny !== undefined && object.deny !== null) ? Deny.fromPartial(object.deny) : undefined; return message; }, }; function createBaseDeny() { return {}; } export const Deny = { encode(_, writer = new BinaryWriter()) { 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 = createBaseDeny(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(_) { return {}; }, toJSON(_) { const obj = {}; return obj; }, create(base) { return Deny.fromPartial(base ?? {}); }, fromPartial(_) { const message = createBaseDeny(); return message; }, }; function createBaseAuthorizeOrDenyDeviceAuthorizationResponse() { return {}; } export const AuthorizeOrDenyDeviceAuthorizationResponse = { encode(_, writer = new BinaryWriter()) { 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 = createBaseAuthorizeOrDenyDeviceAuthorizationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(_) { return {}; }, toJSON(_) { const obj = {}; return obj; }, create(base) { return AuthorizeOrDenyDeviceAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(_) { const message = createBaseAuthorizeOrDenyDeviceAuthorizationResponse(); return message; }, }; export const OIDCServiceDefinition = { name: "OIDCService", fullName: "zitadel.oidc.v2.OIDCService", methods: { getAuthRequest: { name: "GetAuthRequest", requestType: GetAuthRequestRequest, requestStream: false, responseType: GetAuthRequestResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 184, 1, 18, 29, 71, 101, 116, 32, 79, 73, 68, 67, 32, 65, 117, 116, 104, 32, 82, 101, 113, 117, 101, 115, 116, 32, 100, 101, 116, 97, 105, 108, 115, 26, 137, 1, 71, 101, 116, 32, 79, 73, 68, 67, 32, 65, 117, 116, 104, 32, 82, 101, 113, 117, 101, 115, 116, 32, 100, 101, 116, 97, 105, 108, 115, 32, 98, 121, 32, 73, 68, 44, 32, 111, 98, 116, 97, 105, 110, 101, 100, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 114, 101, 100, 105, 114, 101, 99, 116, 32, 85, 82, 76, 46, 32, 82, 101, 116, 117, 114, 110, 115, 32, 100, 101, 116, 97, 105, 108, 115, 32, 116, 104, 97, 116, 32, 97, 114, 101, 32, 112, 97, 114, 115, 101, 100, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 39, 115, 32, 65, 117, 116, 104, 32, 82, 101, 113, 117, 101, 115, 116, 46, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75, ]), ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 42, 18, 40, 47, 118, 50, 47, 111, 105, 100, 99, 47, 97, 117, 116, 104, 95, 114, 101, 113, 117, 101, 115, 116, 115, 47, 123, 97, 117, 116, 104, 95, 114, 101, 113, 117, 101, 115, 116, 95, 105, 100, 125, ]), ], }, }, }, createCallback: { name: "CreateCallback", requestType: CreateCallbackRequest, requestStream: false, responseType: CreateCallbackResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 253, 2, 18, 50, 70, 105, 110, 97, 108, 105, 122, 101, 32, 97, 110, 32, 65, 117, 116, 104, 32, 82, 101, 113, 117, 101, 115, 116, 32, 97, 110, 100, 32, 103, 101, 116, 32, 116, 104, 101, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 85, 82, 76, 46, 26, 185, 2, 70, 105, 110, 97, 108, 105, 122, 101, 32, 97, 110, 32, 65, 117, 116, 104, 32, 82, 101, 113, 117, 101, 115, 116, 32, 97, 110, 100, 32, 103, 101, 116, 32, 116, 104, 101, 32, 99, 97, 108, 108, 98, 97, 99, 107, 32, 85, 82, 76, 32, 102, 111, 114, 32, 115, 117, 99, 99, 101, 115, 115, 32, 111, 114, 32, 102, 97, 105, 108, 117, 114, 101, 46, 32, 84, 104, 101, 32, 117, 115, 101, 114, 32, 109, 117, 115, 116, 32, 98, 101, 32, 114, 101, 100, 105, 114, 101, 99, 116, 101, 100, 32, 116, 111, 32, 116, 104, 101, 32, 85, 82, 76, 32, 105, 110, 32, 111, 114, 100, 101, 114, 32, 116, 111, 32, 105, 110, 102, 111, 114, 109, 32, 116, 104, 101, 32, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 101, 32, 115, 117, 99, 99, 101, 115, 115, 32, 111, 114, 32, 102, 97, 105, 108, 117, 114, 101, 46, 32, 79, 110, 32, 115, 117, 99, 99, 101, 115, 115, 44, 32, 116, 104, 101, 32, 85, 82, 76, 32, 99, 111, 110, 116, 97, 105, 110, 115, 32, 100, 101, 116, 97, 105, 108, 115, 32, 102, 111, 114, 32, 116, 104, 101, 32, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 32, 116, 111, 32, 111, 98, 116, 97, 105, 110, 32, 116, 104, 101, 32, 116, 111, 107, 101, 110, 115, 46, 32, 84, 104, 105, 115, 32, 109, 101, 116, 104, 111, 100, 32, 99, 97, 110, 32, 111, 110, 108, 121, 32, 98, 101, 32, 99, 97, 108, 108, 101, 100, 32, 111, 110, 99, 101, 32, 102, 111, 114, 32, 97, 110, 32, 65, 117, 116, 104, 32, 114, 101, 113, 117, 101, 115, 116, 46, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75, ]), ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 45, 58, 1, 42, 34, 40, 47, 118, 50, 47, 111, 105, 100, 99, 47, 97, 117, 116, 104, 95, 114, 101, 113, 117, 101, 115, 116, 115, 47, 123, 97, 117, 116, 104, 95, 114, 101, 113, 117, 101, 115, 116, 95, 105, 100, 125, ]), ], }, }, }, /** * Get device authorization request * * Get the device authorization based on the provided "user code". * This will return the device authorization request, which contains the device authorization id * that is required to authorize the request once the user signed in or to deny it. */ getDeviceAuthorizationRequest: { name: "GetDeviceAuthorizationRequest", requestType: GetDeviceAuthorizationRequestRequest, requestStream: false, responseType: GetDeviceAuthorizationRequestResponse, responseStream: false, options: { _unknownFields: { 8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 43, 18, 41, 47, 118, 50, 47, 111, 105, 100, 99, 47, 100, 101, 118, 105, 99, 101, 95, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 47, 123, 117, 115, 101, 114, 95, 99, 111, 100, 101, 125, ]), ], }, }, }, /** * Authorize or deny device authorization * * Authorize or deny the device authorization request based on the provided device authorization id. */ authorizeOrDenyDeviceAuthorization: { name: "AuthorizeOrDenyDeviceAuthorization", requestType: AuthorizeOrDenyDeviceAuthorizationRequest, requestStream: false, responseType: AuthorizeOrDenyDeviceAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [Buffer.from([13, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75])], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 60, 58, 1, 42, 34, 55, 47, 118, 50, 47, 111, 105, 100, 99, 47, 100, 101, 118, 105, 99, 101, 95, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 47, 123, 100, 101, 118, 105, 99, 101, 95, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 95, 105, 100, 125, ]), ], }, }, }, }, }; function isSet(value) { return value !== null && value !== undefined; }