Skip to content

Commit

Permalink
feat: telegram miniapp auth
Browse files Browse the repository at this point in the history
  • Loading branch information
gllm-dev committed Oct 16, 2024
1 parent 496afd5 commit dff3dfc
Show file tree
Hide file tree
Showing 20 changed files with 335 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.10] - 2024-09-27
### Added
- Telegram Mini App auth provider

## [0.8.9] - 2024-09-27
### Added
- Telegram auth provider
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/auth-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@heroicons/react": "^2.0.13",
"@openfort/openfort-js": "0.8.9",
"@openfort/openfort-js": "0.8.10",
"@openfort/openfort-node": "^0.6.65",
"@radix-ui/react-toast": "^1.1.2",
"@rainbow-me/rainbowkit": "^2.1.1",
Expand Down
108 changes: 102 additions & 6 deletions packages/internal/openapi-clients/src/backend-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"facebook",
"discord",
"epic_games",
"telegram"
"telegram",
"line"
],
"type": "string"
},
Expand All @@ -65,7 +66,8 @@
"playfab",
"supabase",
"custom",
"oidc"
"oidc",
"telegramMiniApp"
],
"type": "string"
},
Expand Down Expand Up @@ -1421,6 +1423,40 @@
"type": "object",
"additionalProperties": false
},
"OAuthProvider.LINE": {
"enum": [
"line"
],
"type": "string"
},
"LineOAuthConfig": {
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable OAuth provider."
},
"provider": {
"$ref": "#/components/schemas/OAuthProvider.LINE",
"description": "OAuth provider type"
},
"channelId": {
"type": "string",
"description": "Line Channel ID."
},
"channelSecret": {
"type": "string",
"description": "Line Channel secret."
}
},
"required": [
"enabled",
"provider",
"channelId",
"channelSecret"
],
"type": "object",
"additionalProperties": false
},
"OAuthProvider.DISCORD": {
"enum": [
"discord"
Expand Down Expand Up @@ -1455,6 +1491,35 @@
"type": "object",
"additionalProperties": false
},
"ThirdPartyOAuthProvider.TELEGRAM_MINI_APP": {
"enum": [
"telegramMiniApp"
],
"type": "string"
},
"TelegramThirdPartyConfig": {
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable OAuth provider."
},
"provider": {
"$ref": "#/components/schemas/ThirdPartyOAuthProvider.TELEGRAM_MINI_APP",
"description": "OAuth provider type"
},
"botToken": {
"type": "string",
"description": "Telegram bot token."
}
},
"required": [
"enabled",
"provider",
"botToken"
],
"type": "object",
"additionalProperties": false
},
"OAuthProvider.EPIC_GAMES": {
"enum": [
"epic_games"
Expand Down Expand Up @@ -1630,9 +1695,15 @@
{
"$ref": "#/components/schemas/FacebookOAuthConfig"
},
{
"$ref": "#/components/schemas/LineOAuthConfig"
},
{
"$ref": "#/components/schemas/DiscordOAuthConfig"
},
{
"$ref": "#/components/schemas/TelegramThirdPartyConfig"
},
{
"$ref": "#/components/schemas/EpicGamesOAuthConfig"
},
Expand Down Expand Up @@ -6005,15 +6076,17 @@
},
"functionName": {
"type": "string"
},
"wildcard": {
"type": "boolean"
}
},
"required": [
"id",
"object",
"createdAt",
"type",
"contract",
"functionName"
"wildcard"
],
"type": "object",
"additionalProperties": false
Expand Down Expand Up @@ -6843,6 +6916,11 @@
"description": "The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.",
"example": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35"
},
"wildcard": {
"type": "boolean",
"description": "When using `contract_functions` type, set this to `true` to allow all contracts.",
"example": true
},
"gasLimit": {
"type": "string",
"description": "Gas limit in WEI (i.e. factor 10^18).",
Expand Down Expand Up @@ -6894,6 +6972,11 @@
"description": "The contract ID you want to interact with. Must have been added to Openfort first, starts with `con_`.",
"example": "con_0cddb398-1dc6-4e6f-8726-9ec7cea85f35"
},
"wildcard": {
"type": "boolean",
"description": "When using `contract_functions` type, set this to `true` to allow all contracts.",
"example": true
},
"gasLimit": {
"type": "string",
"description": "Gas limit in WEI (i.e. factor 10^18).",
Expand Down Expand Up @@ -7168,8 +7251,7 @@
"address",
"chainId",
"validAfter",
"validUntil",
"player"
"validUntil"
],
"type": "object",
"additionalProperties": false
Expand Down Expand Up @@ -14673,6 +14755,7 @@
{
"createdAt": 1689869074,
"id": "afu_...",
"wildcard": false,
"object": "policyRule",
"type": "contract_functions",
"contract": {
Expand Down Expand Up @@ -14779,6 +14862,7 @@
"value": {
"createdAt": 1689869074,
"id": "afu_...",
"wildcard": false,
"object": "policyRule",
"type": "contract_functions",
"contract": {
Expand Down Expand Up @@ -15195,6 +15279,12 @@
{
"sk": []
},
{
"pk_third_party": []
},
{
"pk_access_token": []
},
{
"pk_identity_token": []
}
Expand Down Expand Up @@ -15290,6 +15380,12 @@
{
"sk": []
},
{
"pk_third_party": []
},
{
"pk_access_token": []
},
{
"pk_identity_token": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ models/inventory-list-response.ts
models/inventory-response.ts
models/jwt-key-response.ts
models/jwt-key.ts
models/line-oauth-config.ts
models/linked-account-response.ts
models/list-subscription-logs-request.ts
models/log-response.ts
Expand All @@ -205,6 +206,7 @@ models/oauth-provider-discord.ts
models/oauth-provider-epicgames.ts
models/oauth-provider-facebook.ts
models/oauth-provider-google.ts
models/oauth-provider-line.ts
models/oauth-provider-telegram.ts
models/oauth-provider-twitter.ts
models/oauth-provider.ts
Expand Down Expand Up @@ -302,13 +304,15 @@ models/subscription-response-plan.ts
models/subscription-response.ts
models/supabase-auth-config.ts
models/telegram-oauth-config.ts
models/telegram-third-party-config.ts
models/third-party-oauth-provider-accelbyte.ts
models/third-party-oauth-provider-custom.ts
models/third-party-oauth-provider-firebase.ts
models/third-party-oauth-provider-lootlocker.ts
models/third-party-oauth-provider-oidc.ts
models/third-party-oauth-provider-playfab.ts
models/third-party-oauth-provider-supabase.ts
models/third-party-oauth-provider-telegramminiapp.ts
models/third-party-oauth-provider.ts
models/third-party-oauth-request.ts
models/time-interval-type.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ export interface ContractPolicyRuleResponse {
* @type {ContractPolicyRuleResponseContract}
* @memberof ContractPolicyRuleResponse
*/
'contract': ContractPolicyRuleResponseContract;
'contract'?: ContractPolicyRuleResponseContract;
/**
*
* @type {string}
* @memberof ContractPolicyRuleResponse
*/
'functionName': string;
'functionName'?: string;
/**
*
* @type {boolean}
* @memberof ContractPolicyRuleResponse
*/
'wildcard': boolean;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ export interface CreatePolicyRuleRequest {
* @memberof CreatePolicyRuleRequest
*/
'contract'?: string;
/**
* When using `contract_functions` type, set this to `true` to allow all contracts.
* @type {boolean}
* @memberof CreatePolicyRuleRequest
*/
'wildcard'?: boolean;
/**
* Gas limit in WEI (i.e. factor 10^18).
* @type {string}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ export interface CreateSessionRequest {
* @type {string}
* @memberof CreateSessionRequest
*/
'player': string;
'player'?: string;
}

4 changes: 4 additions & 0 deletions packages/internal/openapi-clients/src/backend/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export * from './inventory-list-response';
export * from './inventory-response';
export * from './jwt-key';
export * from './jwt-key-response';
export * from './line-oauth-config';
export * from './linked-account-response';
export * from './list-subscription-logs-request';
export * from './log';
Expand All @@ -180,6 +181,7 @@ export * from './oauth-provider-discord';
export * from './oauth-provider-epicgames';
export * from './oauth-provider-facebook';
export * from './oauth-provider-google';
export * from './oauth-provider-line';
export * from './oauth-provider-telegram';
export * from './oauth-provider-twitter';
export * from './oauth-request';
Expand Down Expand Up @@ -276,6 +278,7 @@ export * from './subscription-response';
export * from './subscription-response-plan';
export * from './supabase-auth-config';
export * from './telegram-oauth-config';
export * from './telegram-third-party-config';
export * from './third-party-oauth-provider';
export * from './third-party-oauth-provider-accelbyte';
export * from './third-party-oauth-provider-custom';
Expand All @@ -284,6 +287,7 @@ export * from './third-party-oauth-provider-lootlocker';
export * from './third-party-oauth-provider-oidc';
export * from './third-party-oauth-provider-playfab';
export * from './third-party-oauth-provider-supabase';
export * from './third-party-oauth-provider-telegramminiapp';
export * from './third-party-oauth-request';
export * from './time-interval-type';
export * from './token';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* 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.
*/


// May contain unused imports in some cases
// @ts-ignore
import { OAuthProviderLINE } from './oauth-provider-line';

/**
*
* @export
* @interface LineOAuthConfig
*/
export interface LineOAuthConfig {
/**
* Enable OAuth provider.
* @type {boolean}
* @memberof LineOAuthConfig
*/
'enabled': boolean;
/**
*
* @type {OAuthProviderLINE}
* @memberof LineOAuthConfig
*/
'provider': OAuthProviderLINE;
/**
* Line Channel ID.
* @type {string}
* @memberof LineOAuthConfig
*/
'channelId': string;
/**
* Line Channel secret.
* @type {string}
* @memberof LineOAuthConfig
*/
'channelSecret': string;
}



Loading

0 comments on commit dff3dfc

Please sign in to comment.