UNPKG

@zitadel/node

Version:

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

1,163 lines (1,162 loc) 38.8 kB
// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.5 // protoc unknown // source: zitadel/saml/v2/saml_service.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Details } from "../../object/v2/object.js"; import { AuthorizationError, SAMLRequest } from "./authorization.js"; export const protobufPackage = "zitadel.saml.v2"; function createBaseGetSAMLRequestRequest() { return { samlRequestId: "" }; } export const GetSAMLRequestRequest = { encode(message, writer = new BinaryWriter()) { if (message.samlRequestId !== "") { writer.uint32(10).string(message.samlRequestId); } 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 = createBaseGetSAMLRequestRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.samlRequestId = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { samlRequestId: isSet(object.samlRequestId) ? globalThis.String(object.samlRequestId) : "" }; }, toJSON(message) { const obj = {}; if (message.samlRequestId !== "") { obj.samlRequestId = message.samlRequestId; } return obj; }, create(base) { return GetSAMLRequestRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetSAMLRequestRequest(); message.samlRequestId = object.samlRequestId ?? ""; return message; }, }; function createBaseGetSAMLRequestResponse() { return { samlRequest: undefined }; } export const GetSAMLRequestResponse = { encode(message, writer = new BinaryWriter()) { if (message.samlRequest !== undefined) { SAMLRequest.encode(message.samlRequest, 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 = createBaseGetSAMLRequestResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.samlRequest = SAMLRequest.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { samlRequest: isSet(object.samlRequest) ? SAMLRequest.fromJSON(object.samlRequest) : undefined }; }, toJSON(message) { const obj = {}; if (message.samlRequest !== undefined) { obj.samlRequest = SAMLRequest.toJSON(message.samlRequest); } return obj; }, create(base) { return GetSAMLRequestResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseGetSAMLRequestResponse(); message.samlRequest = (object.samlRequest !== undefined && object.samlRequest !== null) ? SAMLRequest.fromPartial(object.samlRequest) : undefined; return message; }, }; function createBaseCreateResponseRequest() { return { samlRequestId: "", session: undefined, error: undefined }; } export const CreateResponseRequest = { encode(message, writer = new BinaryWriter()) { if (message.samlRequestId !== "") { writer.uint32(10).string(message.samlRequestId); } 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 = createBaseCreateResponseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.samlRequestId = 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 { samlRequestId: isSet(object.samlRequestId) ? globalThis.String(object.samlRequestId) : "", session: isSet(object.session) ? Session.fromJSON(object.session) : undefined, error: isSet(object.error) ? AuthorizationError.fromJSON(object.error) : undefined, }; }, toJSON(message) { const obj = {}; if (message.samlRequestId !== "") { obj.samlRequestId = message.samlRequestId; } 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 CreateResponseRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateResponseRequest(); message.samlRequestId = object.samlRequestId ?? ""; 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 createBaseCreateResponseResponse() { return { details: undefined, url: "", redirect: undefined, post: undefined }; } export const CreateResponseResponse = { encode(message, writer = new BinaryWriter()) { if (message.details !== undefined) { Details.encode(message.details, writer.uint32(10).fork()).join(); } if (message.url !== "") { writer.uint32(18).string(message.url); } if (message.redirect !== undefined) { RedirectResponse.encode(message.redirect, writer.uint32(26).fork()).join(); } if (message.post !== undefined) { PostResponse.encode(message.post, writer.uint32(34).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 = createBaseCreateResponseResponse(); 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.url = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.redirect = RedirectResponse.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 34) { break; } message.post = PostResponse.decode(reader, reader.uint32()); 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, url: isSet(object.url) ? globalThis.String(object.url) : "", redirect: isSet(object.redirect) ? RedirectResponse.fromJSON(object.redirect) : undefined, post: isSet(object.post) ? PostResponse.fromJSON(object.post) : undefined, }; }, toJSON(message) { const obj = {}; if (message.details !== undefined) { obj.details = Details.toJSON(message.details); } if (message.url !== "") { obj.url = message.url; } if (message.redirect !== undefined) { obj.redirect = RedirectResponse.toJSON(message.redirect); } if (message.post !== undefined) { obj.post = PostResponse.toJSON(message.post); } return obj; }, create(base) { return CreateResponseResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateResponseResponse(); message.details = (object.details !== undefined && object.details !== null) ? Details.fromPartial(object.details) : undefined; message.url = object.url ?? ""; message.redirect = (object.redirect !== undefined && object.redirect !== null) ? RedirectResponse.fromPartial(object.redirect) : undefined; message.post = (object.post !== undefined && object.post !== null) ? PostResponse.fromPartial(object.post) : undefined; return message; }, }; function createBaseRedirectResponse() { return {}; } export const RedirectResponse = { 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 = createBaseRedirectResponse(); 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 RedirectResponse.fromPartial(base ?? {}); }, fromPartial(_) { const message = createBaseRedirectResponse(); return message; }, }; function createBasePostResponse() { return { relayState: "", samlResponse: "" }; } export const PostResponse = { encode(message, writer = new BinaryWriter()) { if (message.relayState !== "") { writer.uint32(10).string(message.relayState); } if (message.samlResponse !== "") { writer.uint32(18).string(message.samlResponse); } 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 = createBasePostResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.relayState = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.samlResponse = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { relayState: isSet(object.relayState) ? globalThis.String(object.relayState) : "", samlResponse: isSet(object.samlResponse) ? globalThis.String(object.samlResponse) : "", }; }, toJSON(message) { const obj = {}; if (message.relayState !== "") { obj.relayState = message.relayState; } if (message.samlResponse !== "") { obj.samlResponse = message.samlResponse; } return obj; }, create(base) { return PostResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBasePostResponse(); message.relayState = object.relayState ?? ""; message.samlResponse = object.samlResponse ?? ""; return message; }, }; export const SAMLServiceDefinition = { name: "SAMLService", fullName: "zitadel.saml.v2.SAMLService", methods: { getSAMLRequest: { name: "GetSAMLRequest", requestType: GetSAMLRequestRequest, requestStream: false, responseType: GetSAMLRequestResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 141, 1, 18, 24, 71, 101, 116, 32, 83, 65, 77, 76, 32, 82, 101, 113, 117, 101, 115, 116, 32, 100, 101, 116, 97, 105, 108, 115, 26, 100, 71, 101, 116, 32, 83, 65, 77, 76, 32, 82, 101, 113, 117, 101, 115, 116, 32, 100, 101, 116, 97, 105, 108, 115, 32, 98, 121, 32, 73, 68, 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, 83, 65, 77, 76, 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, 115, 97, 109, 108, 47, 115, 97, 109, 108, 95, 114, 101, 113, 117, 101, 115, 116, 115, 47, 123, 115, 97, 109, 108, 95, 114, 101, 113, 117, 101, 115, 116, 95, 105, 100, 125, ]), ], }, }, }, createResponse: { name: "CreateResponse", requestType: CreateResponseRequest, requestStream: false, responseType: CreateResponseResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 145, 3, 18, 45, 70, 105, 110, 97, 108, 105, 122, 101, 32, 97, 32, 83, 65, 77, 76, 32, 82, 101, 113, 117, 101, 115, 116, 32, 97, 110, 100, 32, 103, 101, 116, 32, 116, 104, 101, 32, 114, 101, 115, 112, 111, 110, 115, 101, 46, 26, 210, 2, 70, 105, 110, 97, 108, 105, 122, 101, 32, 97, 32, 83, 65, 77, 76, 32, 82, 101, 113, 117, 101, 115, 116, 32, 97, 110, 100, 32, 103, 101, 116, 32, 116, 104, 101, 32, 114, 101, 115, 112, 111, 110, 115, 101, 32, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 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, 114, 101, 115, 112, 111, 110, 115, 101, 32, 109, 117, 115, 116, 32, 98, 101, 32, 104, 97, 110, 100, 108, 101, 100, 32, 97, 115, 32, 112, 101, 114, 32, 116, 104, 101, 32, 83, 65, 77, 76, 32, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 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, 114, 101, 115, 112, 111, 110, 115, 101, 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, 83, 65, 77, 76, 82, 101, 115, 112, 111, 110, 115, 101, 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, 83, 65, 77, 76, 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, 115, 97, 109, 108, 47, 115, 97, 109, 108, 95, 114, 101, 113, 117, 101, 115, 116, 115, 47, 123, 115, 97, 109, 108, 95, 114, 101, 113, 117, 101, 115, 116, 95, 105, 100, 125, ]), ], }, }, }, }, }; function isSet(value) { return value !== null && value !== undefined; }