Skip to content

Commit

Permalink
Merge pull request #36 from openfort-xyz/fix/refresh-token
Browse files Browse the repository at this point in the history
Feat/refresh token
  • Loading branch information
jamalavedra authored Jun 20, 2024
2 parents fe0e580 + 8882933 commit 7324746
Show file tree
Hide file tree
Showing 25 changed files with 386 additions and 46 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.7.11] - 2024-06-20
### Fix
- Fix refresh token when using openfort auth
-
## [0.7.10] - 2024-06-20
### Fix
- Fix SDK configuration
Expand Down
Binary file modified examples/apps/auth-sample/.yarn/install-state.gz
Binary file not shown.
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.7.10",
"@openfort/openfort-js": "0.7.11",
"@openfort/openfort-node": "^0.6.47",
"@radix-ui/react-toast": "^1.1.2",
"@rainbow-me/rainbowkit": "^2.1.1",
Expand Down
1 change: 0 additions & 1 deletion packages/internal/openapi-clients/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: generate-backend-openapi
generate-backend-openapi: get-backend-openapi generate-backend-api-client

# TODO: update URL once we release to testnet
.PHONY: get-backend-openapi
get-backend-openapi:
rm -f src/backend-openapi.json && touch src/backend-openapi.json && \
Expand Down
110 changes: 102 additions & 8 deletions packages/internal/openapi-clients/src/backend-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,11 @@
},
"dataSuffix": {
"type": "string",
"description": "Data to append to the end of the calldata. Useful for [adding a \"domain\" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)",
"example": "0x12345678"
"description": "Data to append to the end of the calldata. Useful for [adding a \"domain\" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f)"
},
"data": {
"type": "string",
"description": "The encoded calldata of the contract.",
"example": "0x12345678"
"description": "The encoded calldata of the contract."
}
},
"type": "object",
Expand Down Expand Up @@ -845,7 +843,9 @@
"enum": [
"google",
"twitter",
"facebook"
"facebook",
"discord",
"epic_games"
],
"type": "string"
},
Expand Down Expand Up @@ -1081,6 +1081,74 @@
"type": "object",
"additionalProperties": false
},
"OAuthProvider.DISCORD": {
"enum": [
"discord"
],
"type": "string"
},
"DiscordOAuthConfig": {
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable OAuth provider."
},
"provider": {
"$ref": "#/components/schemas/OAuthProvider.DISCORD",
"description": "OAuth provider type"
},
"clientId": {
"type": "string",
"description": "Discord API client ID."
},
"clientSecret": {
"type": "string",
"description": "Discord API client secret."
}
},
"required": [
"enabled",
"provider",
"clientId",
"clientSecret"
],
"type": "object",
"additionalProperties": false
},
"OAuthProvider.EPIC_GAMES": {
"enum": [
"epic_games"
],
"type": "string"
},
"EpicGamesOAuthConfig": {
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable OAuth provider."
},
"provider": {
"$ref": "#/components/schemas/OAuthProvider.EPIC_GAMES",
"description": "OAuth provider type"
},
"clientId": {
"type": "string",
"description": "Epic Games API client ID."
},
"clientSecret": {
"type": "string",
"description": "Epic Games API client secret."
}
},
"required": [
"enabled",
"provider",
"clientId",
"clientSecret"
],
"type": "object",
"additionalProperties": false
},
"ThirdPartyOAuthProvider.PLAYFAB": {
"enum": [
"playfab"
Expand Down Expand Up @@ -1219,6 +1287,12 @@
{
"$ref": "#/components/schemas/FacebookOAuthConfig"
},
{
"$ref": "#/components/schemas/DiscordOAuthConfig"
},
{
"$ref": "#/components/schemas/EpicGamesOAuthConfig"
},
{
"$ref": "#/components/schemas/PlayFabOAuthConfig"
},
Expand Down Expand Up @@ -1339,6 +1413,21 @@
"type": "object",
"additionalProperties": false
},
"OAuthProvders": {
"enum": [
"google",
"twitter",
"facebook",
"accelbyte",
"firebase",
"lootlocker",
"playfab",
"supabase",
"custom",
"oidc"
],
"type": "string"
},
"TokenType": {
"description": "Enum of the supporting OAuth providers.",
"enum": [
Expand All @@ -1358,7 +1447,7 @@
"AuthenticateOAuthRequest": {
"properties": {
"provider": {
"$ref": "#/components/schemas/AuthProvider",
"$ref": "#/components/schemas/OAuthProvders",
"description": "OAuth provider",
"example": "firebase"
},
Expand Down Expand Up @@ -1677,8 +1766,13 @@
"properties": {
"refreshToken": {
"type": "string",
"description": "Specifies the session.",
"description": "Specifies the session refresh token.",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
},
"forceRefresh": {
"type": "boolean",
"description": "Specifies whether to force refresh the session.",
"example": false
}
},
"required": [
Expand Down Expand Up @@ -9092,7 +9186,7 @@
],
"security": [
{
"pk_access_token": []
"pk": []
}
],
"parameters": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ models/developer-account-response.ts
models/developer-account.ts
models/device-list-queries.ts
models/device-response.ts
models/discord-oauth-config.ts
models/domain-data.ts
models/email-sample-delete-response.ts
models/email-sample-response.ts
Expand Down Expand Up @@ -145,6 +146,7 @@ models/entity-type-trigger.ts
models/entity-type-user.ts
models/entity-type-web3-action.ts
models/entity-type-web3-connection.ts
models/epic-games-oauth-config.ts
models/error-type-invalidrequesterror.ts
models/estimate-transaction-intent-gas-result.ts
models/event-delete-response.ts
Expand Down Expand Up @@ -186,6 +188,9 @@ models/oauth-config-list-response.ts
models/oauth-config.ts
models/oauth-init-request-options.ts
models/oauth-init-request.ts
models/oauth-provders.ts
models/oauth-provider-discord.ts
models/oauth-provider-epicgames.ts
models/oauth-provider-facebook.ts
models/oauth-provider-google.ts
models/oauth-provider-twitter.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ export const AuthenticationApiAxiosParamCreator = function (configuration?: Conf
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

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



localVarHeaderParameter['Content-Type'] = 'application/json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// May contain unused imports in some cases
// @ts-ignore
import { AuthProvider } from './auth-provider';
import { OAuthProvders } from './oauth-provders';
// May contain unused imports in some cases
// @ts-ignore
import { PlayerResponseExpandable } from './player-response-expandable';
Expand All @@ -31,10 +31,10 @@ import { TokenType } from './token-type';
export interface AuthenticateOAuthRequest {
/**
*
* @type {AuthProvider}
* @type {OAuthProvders}
* @memberof AuthenticateOAuthRequest
*/
'provider': AuthProvider;
'provider': OAuthProvders;
/**
* Token to be verified
* @type {string}
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: founders@openfort.xyz
*
* 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 { OAuthProviderDISCORD } from './oauth-provider-discord';

/**
*
* @export
* @interface DiscordOAuthConfig
*/
export interface DiscordOAuthConfig {
/**
* Enable OAuth provider.
* @type {boolean}
* @memberof DiscordOAuthConfig
*/
'enabled': boolean;
/**
*
* @type {OAuthProviderDISCORD}
* @memberof DiscordOAuthConfig
*/
'provider': OAuthProviderDISCORD;
/**
* Discord API client ID.
* @type {string}
* @memberof DiscordOAuthConfig
*/
'clientId': string;
/**
* Discord API client secret.
* @type {string}
* @memberof DiscordOAuthConfig
*/
'clientSecret': string;
}



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: founders@openfort.xyz
*
* 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 { OAuthProviderEPICGAMES } from './oauth-provider-epicgames';

/**
*
* @export
* @interface EpicGamesOAuthConfig
*/
export interface EpicGamesOAuthConfig {
/**
* Enable OAuth provider.
* @type {boolean}
* @memberof EpicGamesOAuthConfig
*/
'enabled': boolean;
/**
*
* @type {OAuthProviderEPICGAMES}
* @memberof EpicGamesOAuthConfig
*/
'provider': OAuthProviderEPICGAMES;
/**
* Epic Games API client ID.
* @type {string}
* @memberof EpicGamesOAuthConfig
*/
'clientId': string;
/**
* Epic Games API client secret.
* @type {string}
* @memberof EpicGamesOAuthConfig
*/
'clientSecret': string;
}



5 changes: 5 additions & 0 deletions packages/internal/openapi-clients/src/backend/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export * from './developer-account-response';
export * from './developer-account-response-expandable';
export * from './device-list-queries';
export * from './device-response';
export * from './discord-oauth-config';
export * from './domain-data';
export * from './email-sample-delete-response';
export * from './email-sample-response';
Expand Down Expand Up @@ -120,6 +121,7 @@ export * from './entity-type-trigger';
export * from './entity-type-user';
export * from './entity-type-web3-action';
export * from './entity-type-web3-connection';
export * from './epic-games-oauth-config';
export * from './error-type-invalidrequesterror';
export * from './estimate-transaction-intent-gas-result';
export * from './event-delete-response';
Expand Down Expand Up @@ -160,7 +162,10 @@ export * from './oauth-config';
export * from './oauth-config-list-response';
export * from './oauth-init-request';
export * from './oauth-init-request-options';
export * from './oauth-provders';
export * from './oauth-provider';
export * from './oauth-provider-discord';
export * from './oauth-provider-epicgames';
export * from './oauth-provider-facebook';
export * from './oauth-provider-google';
export * from './oauth-provider-twitter';
Expand Down
Loading

0 comments on commit 7324746

Please sign in to comment.