@pake/hydra-client
Version:
OpenAPI client for @ory/hydra-client
728 lines • 241 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* ORY Hydra
* Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
*
* The version of the OpenAPI document: v1.9.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PublicApi = exports.PublicApiFactory = exports.PublicApiFp = exports.PublicApiAxiosParamCreator = exports.AdminApi = exports.AdminApiFactory = exports.AdminApiFp = exports.AdminApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const base_1 = require("./base");
/**
* AdminApi - axios parameter creator
* @export
*/
const AdminApiAxiosParamCreator = function (configuration) {
return {
/**
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject\'s behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider\'s URL to which the subject\'s user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request. This endpoint tells ORY Hydra that the subject has authorized the OAuth 2.0 client to access resources on his/her behalf. The consent provider includes additional information, such as session data for access and ID tokens, and if the consent request should be used as basis for future requests. The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @summary Accept a Consent Request
* @param {string} consentChallenge
* @param {AcceptConsentRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptConsentRequest: (consentChallenge, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'consentChallenge' is not null or undefined
if (consentChallenge === null || consentChallenge === undefined) {
throw new base_1.RequiredError('consentChallenge', 'Required parameter consentChallenge was null or undefined when calling acceptConsentRequest.');
}
const localVarPath = `/oauth2/auth/requests/consent/accept`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (consentChallenge !== undefined) {
localVarQueryParameter['consent_challenge'] = consentChallenge;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const nonString = typeof body !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type'])
: nonString;
localVarRequestOptions.data = needsSerialization
? JSON.stringify(body !== undefined ? body : {})
: (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject\'s user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process. This endpoint tells ORY Hydra that the subject has successfully authenticated and includes additional information such as the subject\'s ID and if ORY Hydra should remember the subject\'s subject agent for future authentication attempts by setting a cookie. The response contains a redirect URL which the login provider should redirect the user-agent to.
* @summary Accept a Login Request
* @param {string} loginChallenge
* @param {AcceptLoginRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptLoginRequest: (loginChallenge, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'loginChallenge' is not null or undefined
if (loginChallenge === null || loginChallenge === undefined) {
throw new base_1.RequiredError('loginChallenge', 'Required parameter loginChallenge was null or undefined when calling acceptLoginRequest.');
}
const localVarPath = `/oauth2/auth/requests/login/accept`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (loginChallenge !== undefined) {
localVarQueryParameter['login_challenge'] = loginChallenge;
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const nonString = typeof body !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type'])
: nonString;
localVarRequestOptions.data = needsSerialization
? JSON.stringify(body !== undefined ? body : {})
: (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* When a user or an application requests ORY Hydra to log out a user, this endpoint is used to confirm that logout request. No body is required. The response contains a redirect URL which the consent provider should redirect the user-agent to.
* @summary Accept a Logout Request
* @param {string} logoutChallenge
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptLogoutRequest: (logoutChallenge, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'logoutChallenge' is not null or undefined
if (logoutChallenge === null || logoutChallenge === undefined) {
throw new base_1.RequiredError('logoutChallenge', 'Required parameter logoutChallenge was null or undefined when calling acceptLogoutRequest.');
}
const localVarPath = `/oauth2/auth/requests/logout/accept`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (logoutChallenge !== undefined) {
localVarQueryParameter['logout_challenge'] = logoutChallenge;
}
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint is capable of generating JSON Web Key Sets for you. There a different strategies available, such as symmetric cryptographic keys (HS256, HS512) and asymetric cryptographic keys (RS256, ECDSA). If the specified JSON Web Key Set does not exist, it will be created. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @summary Generate a New JSON Web Key
* @param {string} set The set
* @param {JsonWebKeySetGeneratorRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createJsonWebKeySet: (set, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'set' is not null or undefined
if (set === null || set === undefined) {
throw new base_1.RequiredError('set', 'Required parameter set was null or undefined when calling createJsonWebKeySet.');
}
const localVarPath = `/keys/{set}`
.replace(`{${"set"}}`, encodeURIComponent(String(set)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const nonString = typeof body !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type'])
: nonString;
localVarRequestOptions.data = needsSerialization
? JSON.stringify(body !== undefined ? body : {})
: (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Create a new OAuth 2.0 client If you pass `client_secret` the secret will be used, otherwise a random secret will be generated. The secret will be returned in the response and you will not be able to retrieve it later on. Write the secret down and keep it somwhere safe. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
* @summary Create an OAuth 2.0 Client
* @param {OAuth2Client} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createOAuth2Client: (body, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new base_1.RequiredError('body', 'Required parameter body was null or undefined when calling createOAuth2Client.');
}
const localVarPath = `/clients`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const nonString = typeof body !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type'])
: nonString;
localVarRequestOptions.data = needsSerialization
? JSON.stringify(body !== undefined ? body : {})
: (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Use this endpoint to delete a single JSON Web Key. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @summary Delete a JSON Web Key
* @param {string} kid The kid of the desired key
* @param {string} set The set
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteJsonWebKey: (kid, set, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'kid' is not null or undefined
if (kid === null || kid === undefined) {
throw new base_1.RequiredError('kid', 'Required parameter kid was null or undefined when calling deleteJsonWebKey.');
}
// verify required parameter 'set' is not null or undefined
if (set === null || set === undefined) {
throw new base_1.RequiredError('set', 'Required parameter set was null or undefined when calling deleteJsonWebKey.');
}
const localVarPath = `/keys/{set}/{kid}`
.replace(`{${"kid"}}`, encodeURIComponent(String(kid)))
.replace(`{${"set"}}`, encodeURIComponent(String(set)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Use this endpoint to delete a complete JSON Web Key Set and all the keys in that set. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @summary Delete a JSON Web Key Set
* @param {string} set The set
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteJsonWebKeySet: (set, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'set' is not null or undefined
if (set === null || set === undefined) {
throw new base_1.RequiredError('set', 'Required parameter set was null or undefined when calling deleteJsonWebKeySet.');
}
const localVarPath = `/keys/{set}`
.replace(`{${"set"}}`, encodeURIComponent(String(set)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Delete an existing OAuth 2.0 Client by its ID. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
* @summary Deletes an OAuth 2.0 Client
* @param {string} id The id of the OAuth 2.0 Client.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteOAuth2Client: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling deleteOAuth2Client.');
}
const localVarPath = `/clients/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint deletes OAuth2 access tokens issued for a client from the database
* @summary Delete OAuth2 Access Tokens from a Client
* @param {string} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteOAuth2Token: (clientId, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'clientId' is not null or undefined
if (clientId === null || clientId === undefined) {
throw new base_1.RequiredError('clientId', 'Required parameter clientId was null or undefined when calling deleteOAuth2Token.');
}
const localVarPath = `/oauth2/tokens`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (clientId !== undefined) {
localVarQueryParameter['client_id'] = clientId;
}
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint flushes expired OAuth2 access tokens from the database. You can set a time after which no tokens will be not be touched, in case you want to keep recent tokens for auditing. Refresh tokens can not be flushed as they are deleted automatically when performing the refresh flow.
* @summary Flush Expired OAuth2 Access Tokens
* @param {FlushInactiveOAuth2TokensRequest} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
flushInactiveOAuth2Tokens: (body, options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/oauth2/flush`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
const nonString = typeof body !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(localVarRequestOptions.headers['Content-Type'])
: nonString;
localVarRequestOptions.data = needsSerialization
? JSON.stringify(body !== undefined ? body : {})
: (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider to authenticate the subject and then tell ORY Hydra now about it. If the subject authenticated, he/she must now be asked if the OAuth 2.0 Client which initiated the flow should be allowed to access the resources on the subject\'s behalf. The consent provider which handles this request and is a web app implemented and hosted by you. It shows a subject interface which asks the subject to grant or deny the client access to the requested scope (\"Application my-dropbox-app wants write access to all your private files\"). The consent challenge is appended to the consent provider\'s URL to which the subject\'s user-agent (browser) is redirected to. The consent provider uses that challenge to fetch information on the OAuth2 request and then tells ORY Hydra if the subject accepted or rejected the request.
* @summary Get Consent Request Information
* @param {string} consentChallenge
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getConsentRequest: (consentChallenge, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'consentChallenge' is not null or undefined
if (consentChallenge === null || consentChallenge === undefined) {
throw new base_1.RequiredError('consentChallenge', 'Required parameter consentChallenge was null or undefined when calling getConsentRequest.');
}
const localVarPath = `/oauth2/auth/requests/consent`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (consentChallenge !== undefined) {
localVarQueryParameter['consent_challenge'] = consentChallenge;
}
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint returns a singular JSON Web Key, identified by the set and the specific key ID (kid).
* @summary Fetch a JSON Web Key
* @param {string} kid The kid of the desired key
* @param {string} set The set
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getJsonWebKey: (kid, set, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'kid' is not null or undefined
if (kid === null || kid === undefined) {
throw new base_1.RequiredError('kid', 'Required parameter kid was null or undefined when calling getJsonWebKey.');
}
// verify required parameter 'set' is not null or undefined
if (set === null || set === undefined) {
throw new base_1.RequiredError('set', 'Required parameter set was null or undefined when calling getJsonWebKey.');
}
const localVarPath = `/keys/{set}/{kid}`
.replace(`{${"kid"}}`, encodeURIComponent(String(kid)))
.replace(`{${"set"}}`, encodeURIComponent(String(set)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint can be used to retrieve JWK Sets stored in ORY Hydra. A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. A JWK Set is a JSON data structure that represents a set of JWKs. A JSON Web Key is identified by its set and key id. ORY Hydra uses this functionality to store cryptographic keys used for TLS and JSON Web Tokens (such as OpenID Connect ID tokens), and allows storing user-defined keys as well.
* @summary Retrieve a JSON Web Key Set
* @param {string} set The set
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getJsonWebKeySet: (set, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'set' is not null or undefined
if (set === null || set === undefined) {
throw new base_1.RequiredError('set', 'Required parameter set was null or undefined when calling getJsonWebKeySet.');
}
const localVarPath = `/keys/{set}`
.replace(`{${"set"}}`, encodeURIComponent(String(set)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* When an authorization code, hybrid, or implicit OAuth 2.0 Flow is initiated, ORY Hydra asks the login provider (sometimes called \"identity provider\") to authenticate the subject and then tell ORY Hydra now about it. The login provider is an web-app you write and host, and it must be able to authenticate (\"show the subject a login screen\") a subject (in OAuth2 the proper name for subject is \"resource owner\"). The authentication challenge is appended to the login provider URL to which the subject\'s user-agent (browser) is redirected to. The login provider uses that challenge to fetch information on the OAuth2 request and then accept or reject the requested authentication process.
* @summary Get a Login Request
* @param {string} loginChallenge
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getLoginRequest: (loginChallenge, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'loginChallenge' is not null or undefined
if (loginChallenge === null || loginChallenge === undefined) {
throw new base_1.RequiredError('loginChallenge', 'Required parameter loginChallenge was null or undefined when calling getLoginRequest.');
}
const localVarPath = `/oauth2/auth/requests/login`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (loginChallenge !== undefined) {
localVarQueryParameter['login_challenge'] = loginChallenge;
}
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Use this endpoint to fetch a logout request.
* @summary Get a Logout Request
* @param {string} logoutChallenge
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getLogoutRequest: (logoutChallenge, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'logoutChallenge' is not null or undefined
if (logoutChallenge === null || logoutChallenge === undefined) {
throw new base_1.RequiredError('logoutChallenge', 'Required parameter logoutChallenge was null or undefined when calling getLogoutRequest.');
}
const localVarPath = `/oauth2/auth/requests/logout`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (logoutChallenge !== undefined) {
localVarQueryParameter['logout_challenge'] = logoutChallenge;
}
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* Get an OAUth 2.0 client by its ID. This endpoint never returns passwords. OAuth 2.0 clients are used to perform OAuth 2.0 and OpenID Connect flows. Usually, OAuth 2.0 clients are generated for applications which want to consume your OAuth 2.0 or OpenID Connect capabilities. To manage ORY Hydra, you will need an OAuth 2.0 Client as well. Make sure that this endpoint is well protected and only callable by first-party components.
* @summary Get an OAuth 2.0 Client.
* @param {string} id The id of the OAuth 2.0 Client.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getOAuth2Client: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new base_1.RequiredError('id', 'Required parameter id was null or undefined when calling getOAuth2Client.');
}
const localVarPath = `/clients/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const key in options.query) {
queryParameters.set(key, options.query[key]);
}
localVarUrlObj.search = (new URLSearchParams(queryParameters)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
}),
/**
* This endpoint returns the service version typically notated using semantic versioning. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set.
* @summary Get Service Version
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getVersion: (options = {}) => __awaiter(this, void 0, void 0, function* () {
const localVarPath = `/version`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
const queryParameters = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
queryParameters.set(key, localVarQueryParameter[key]);
}
for (const