Skip to content

Commit

Permalink
chore: add telegram oauth provider
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Oct 11, 2024
1 parent b859ec7 commit 37b4f90
Show file tree
Hide file tree
Showing 24 changed files with 1,605 additions and 177 deletions.
827 changes: 680 additions & 147 deletions packages/internal/openapi-clients/src/backend-openapi.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ domain/accounts-api.ts
domain/admin-authentication-api.ts
domain/authentication-api.ts
domain/contracts-api.ts
domain/default-api.ts
domain/events-api.ts
domain/exchange-api.ts
domain/inventories-api.ts
Expand Down Expand Up @@ -53,11 +54,14 @@ models/auth-player-list-response.ts
models/auth-player-response-player.ts
models/auth-player-response-with-recovery-share.ts
models/auth-player-response.ts
models/auth-provider-list-response.ts
models/auth-provider-response.ts
models/auth-provider-with-type-response.ts
models/auth-provider.ts
models/auth-response.ts
models/auth-session-response.ts
models/authenticate-oauth-request.ts
models/authentication-type.ts
models/authorize-player-request.ts
models/authorize200-response.ts
models/balance-event-response.ts
Expand Down Expand Up @@ -165,7 +169,8 @@ models/fixed-rate-token-policy-strategy.ts
models/gas-per-interval-limit-policy-rule-response.ts
models/gas-per-transaction-limit-policy-rule-response.ts
models/gas-report-list-response.ts
models/gas-report-transaction-intents-inner.ts
models/gas-report-transaction-intents-list-response.ts
models/gas-report-transaction-intents.ts
models/gas-report.ts
models/google-oauth-config.ts
models/index.ts
Expand All @@ -181,11 +186,13 @@ models/linked-account-response.ts
models/list-subscription-logs-request.ts
models/log-response.ts
models/log.ts
models/login-oidcrequest.ts
models/login-request.ts
models/logout-request.ts
models/loot-locker-oauth-config.ts
models/money.ts
models/month-range.ts
models/my-ecosystem-response.ts
models/next-action-payload.ts
models/next-action-response.ts
models/next-action-type.ts
Expand All @@ -198,6 +205,7 @@ models/oauth-provider-discord.ts
models/oauth-provider-epicgames.ts
models/oauth-provider-facebook.ts
models/oauth-provider-google.ts
models/oauth-provider-telegram.ts
models/oauth-provider-twitter.ts
models/oauth-provider.ts
models/oauth-request.ts
Expand Down Expand Up @@ -235,6 +243,8 @@ models/policy-rate-limit-countperinterval.ts
models/policy-rate-limit-gasperinterval.ts
models/policy-rate-limit-gaspertransaction.ts
models/policy-rate-limit.ts
models/policy-report-queries.ts
models/policy-report-transaction-intents-queries.ts
models/policy-response-expandable.ts
models/policy-response-policy-rules-inner.ts
models/policy-response.ts
Expand Down Expand Up @@ -291,6 +301,7 @@ models/subscription-list-response.ts
models/subscription-response-plan.ts
models/subscription-response.ts
models/supabase-auth-config.ts
models/telegram-oauth-config.ts
models/third-party-oauth-provider-accelbyte.ts
models/third-party-oauth-provider-custom.ts
models/third-party-oauth-provider-firebase.ts
Expand Down
1 change: 1 addition & 0 deletions packages/internal/openapi-clients/src/backend/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export * from './domain/accounts-api';
export * from './domain/admin-authentication-api';
export * from './domain/authentication-api';
export * from './domain/contracts-api';
export * from './domain/default-api';
export * from './domain/events-api';
export * from './domain/exchange-api';
export * from './domain/inventories-api';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { DeprecatedAuthenticatedPlayerResponse } from '../models';
// @ts-ignore
import { JwtKeyResponse } from '../models';
// @ts-ignore
import { LoginOIDCRequest } from '../models';
// @ts-ignore
import { LoginRequest } from '../models';
// @ts-ignore
import { LogoutRequest } from '../models';
Expand Down Expand Up @@ -491,6 +493,51 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf
options: localVarRequestOptions,
};
},
/**
* Authenticate a player from an identity token.
* @summary OIDC Identity token.
* @param {LoginOIDCRequest} loginOIDCRequest
* @param {string} [xGame]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
loginOIDC: async (loginOIDCRequest: LoginOIDCRequest, xGame?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'loginOIDCRequest' is not null or undefined
assertParamExists('loginOIDC', 'loginOIDCRequest', loginOIDCRequest)
const localVarPath = `/iam/v1/oidc/login`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication pk required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)

if (xGame != null) {
localVarHeaderParameter['x-game'] = String(xGame);
}



localVarHeaderParameter['Content-Type'] = 'application/json';

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(loginOIDCRequest, localVarRequestOptions, configuration)

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* When using Openfort Auth, the endpoint logs out the player.
* @summary Log out a player.
Expand Down Expand Up @@ -1206,6 +1253,18 @@ export const AuthenticationApiFp = function(configuration?: Configuration) {
const localVarAxiosArgs = await localVarAxiosParamCreator.loginEmailPassword(loginRequest, xGame, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Authenticate a player from an identity token.
* @summary OIDC Identity token.
* @param {LoginOIDCRequest} loginOIDCRequest
* @param {string} [xGame]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async loginOIDC(loginOIDCRequest: LoginOIDCRequest, xGame?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.loginOIDC(loginOIDCRequest, xGame, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* When using Openfort Auth, the endpoint logs out the player.
* @summary Log out a player.
Expand Down Expand Up @@ -1483,6 +1542,16 @@ export const AuthenticationApiFactory = function (configuration?: Configuration,
loginEmailPassword(requestParameters: AuthenticationApiLoginEmailPasswordRequest, options?: AxiosRequestConfig): AxiosPromise<AuthResponse> {
return localVarFp.loginEmailPassword(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(axios, basePath));
},
/**
* Authenticate a player from an identity token.
* @summary OIDC Identity token.
* @param {AuthenticationApiLoginOIDCRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
loginOIDC(requestParameters: AuthenticationApiLoginOIDCRequest, options?: AxiosRequestConfig): AxiosPromise<AuthResponse> {
return localVarFp.loginOIDC(requestParameters.loginOIDCRequest, requestParameters.xGame, options).then((request) => request(axios, basePath));
},
/**
* When using Openfort Auth, the endpoint logs out the player.
* @summary Log out a player.
Expand Down Expand Up @@ -1816,6 +1885,27 @@ export interface AuthenticationApiLoginEmailPasswordRequest {
readonly xGame?: string
}

/**
* Request parameters for loginOIDC operation in AuthenticationApi.
* @export
* @interface AuthenticationApiLoginOIDCRequest
*/
export interface AuthenticationApiLoginOIDCRequest {
/**
*
* @type {LoginOIDCRequest}
* @memberof AuthenticationApiLoginOIDC
*/
readonly loginOIDCRequest: LoginOIDCRequest

/**
*
* @type {string}
* @memberof AuthenticationApiLoginOIDC
*/
readonly xGame?: string
}

/**
* Request parameters for logout operation in AuthenticationApi.
* @export
Expand Down Expand Up @@ -2161,6 +2251,18 @@ export class AuthenticationApi extends BaseAPI {
return AuthenticationApiFp(this.configuration).loginEmailPassword(requestParameters.loginRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
}

/**
* Authenticate a player from an identity token.
* @summary OIDC Identity token.
* @param {AuthenticationApiLoginOIDCRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthenticationApi
*/
public loginOIDC(requestParameters: AuthenticationApiLoginOIDCRequest, options?: AxiosRequestConfig) {
return AuthenticationApiFp(this.configuration).loginOIDC(requestParameters.loginOIDCRequest, requestParameters.xGame, options).then((request) => request(this.axios, this.basePath));
}

/**
* When using Openfort Auth, the endpoint logs out the player.
* @summary Log out a player.
Expand Down
126 changes: 126 additions & 0 deletions packages/internal/openapi-clients/src/backend/domain/default-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/* tslint:disable */
/* eslint-disable */
/**
* Openfort API
* Complete Openfort API references and guides can be found at: https://openfort.xyz/docs
*
* The version of the OpenAPI document: 1.0.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { AuthProviderListResponse } from '../models';
/**
* DefaultApi - axios parameter creator
* @export
*/
export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* List available authentication methods for the current project environment.
* @summary List of available authentication methods.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAvailableAuthProviders: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/iam/v1/providers`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication pk required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration)



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};

/**
* DefaultApi - functional programming interface
* @export
*/
export const DefaultApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
return {
/**
* List available authentication methods for the current project environment.
* @summary List of available authentication methods.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async listAvailableAuthProviders(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AuthProviderListResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listAvailableAuthProviders(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* DefaultApi - factory interface
* @export
*/
export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = DefaultApiFp(configuration)
return {
/**
* List available authentication methods for the current project environment.
* @summary List of available authentication methods.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAvailableAuthProviders(options?: AxiosRequestConfig): AxiosPromise<AuthProviderListResponse> {
return localVarFp.listAvailableAuthProviders(options).then((request) => request(axios, basePath));
},
};
};

/**
* DefaultApi - object-oriented interface
* @export
* @class DefaultApi
* @extends {BaseAPI}
*/
export class DefaultApi extends BaseAPI {
/**
* List available authentication methods for the current project environment.
* @summary List of available authentication methods.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApi
*/
public listAvailableAuthProviders(options?: AxiosRequestConfig) {
return DefaultApiFp(this.configuration).listAvailableAuthProviders(options).then((request) => request(this.axios, this.basePath));
}
}

Loading

0 comments on commit 37b4f90

Please sign in to comment.