|
57 | 57 | import io.supertokens.pluginInterface.multitenancy.exceptions.DuplicateThirdPartyIdException;
|
58 | 58 | import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
|
59 | 59 | import io.supertokens.pluginInterface.multitenancy.sqlStorage.MultitenancySQLStorage;
|
| 60 | +import io.supertokens.pluginInterface.oauth.OAuthLogoutChallenge; |
| 61 | +import io.supertokens.pluginInterface.oauth.OAuthStorage; |
60 | 62 | import io.supertokens.pluginInterface.passwordless.PasswordlessCode;
|
61 | 63 | import io.supertokens.pluginInterface.passwordless.PasswordlessDevice;
|
62 | 64 | import io.supertokens.pluginInterface.passwordless.exception.*;
|
@@ -112,7 +114,7 @@ public class Start
|
112 | 114 | implements SessionSQLStorage, EmailPasswordSQLStorage, EmailVerificationSQLStorage, ThirdPartySQLStorage,
|
113 | 115 | JWTRecipeSQLStorage, PasswordlessSQLStorage, UserMetadataSQLStorage, UserRolesSQLStorage, UserIdMappingStorage,
|
114 | 116 | UserIdMappingSQLStorage, MultitenancyStorage, MultitenancySQLStorage, DashboardSQLStorage, TOTPSQLStorage,
|
115 |
| - ActiveUsersStorage, ActiveUsersSQLStorage, AuthRecipeSQLStorage { |
| 117 | + ActiveUsersStorage, ActiveUsersSQLStorage, AuthRecipeSQLStorage, OAuthStorage { |
116 | 118 |
|
117 | 119 | // these configs are protected from being modified / viewed by the dev using the SuperTokens
|
118 | 120 | // SaaS. If the core is not running in SuperTokens SaaS, this array has no effect.
|
@@ -3034,6 +3036,161 @@ public int countUsersThatHaveMoreThanOneLoginMethodOrTOTPEnabledAndActiveSince(A
|
3034 | 3036 | }
|
3035 | 3037 | }
|
3036 | 3038 |
|
| 3039 | + @Override |
| 3040 | + public boolean doesClientIdExistForApp(AppIdentifier appIdentifier, String clientId) |
| 3041 | + throws StorageQueryException { |
| 3042 | + try { |
| 3043 | + return OAuthQueries.isClientIdForAppId(this, clientId, appIdentifier); |
| 3044 | + } catch (SQLException e) { |
| 3045 | + throw new StorageQueryException(e); |
| 3046 | + } |
| 3047 | + } |
| 3048 | + |
| 3049 | + @Override |
| 3050 | + public void addOrUpdateClientForApp(AppIdentifier appIdentifier, String clientId, boolean isClientCredentialsOnly) |
| 3051 | + throws StorageQueryException { |
| 3052 | + try { |
| 3053 | + OAuthQueries.insertClientIdForAppId(this, appIdentifier, clientId, isClientCredentialsOnly); |
| 3054 | + } catch (SQLException e) { |
| 3055 | + throw new StorageQueryException(e); |
| 3056 | + } |
| 3057 | + } |
| 3058 | + |
| 3059 | + @Override |
| 3060 | + public boolean removeAppClientAssociation(AppIdentifier appIdentifier, String clientId) |
| 3061 | + throws StorageQueryException { |
| 3062 | + try { |
| 3063 | + return OAuthQueries.deleteClientIdForAppId(this, clientId, appIdentifier); |
| 3064 | + } catch (SQLException e) { |
| 3065 | + throw new StorageQueryException(e); |
| 3066 | + } |
| 3067 | + } |
| 3068 | + |
| 3069 | + @Override |
| 3070 | + public List<String> listClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException { |
| 3071 | + try { |
| 3072 | + return OAuthQueries.listClientsForApp(this, appIdentifier); |
| 3073 | + } catch (SQLException e) { |
| 3074 | + throw new StorageQueryException(e); |
| 3075 | + } |
| 3076 | + } |
| 3077 | + |
| 3078 | + @Override |
| 3079 | + public void revoke(AppIdentifier appIdentifier, String targetType, String targetValue, long exp) |
| 3080 | + throws StorageQueryException { |
| 3081 | + try { |
| 3082 | + OAuthQueries.revoke(this, appIdentifier, targetType, targetValue, exp); |
| 3083 | + } catch (SQLException e) { |
| 3084 | + throw new StorageQueryException(e); |
| 3085 | + } |
| 3086 | + } |
| 3087 | + |
| 3088 | + @Override |
| 3089 | + public boolean isRevoked(AppIdentifier appIdentifier, String[] targetTypes, String[] targetValues, long issuedAt) |
| 3090 | + throws StorageQueryException { |
| 3091 | + try { |
| 3092 | + return OAuthQueries.isRevoked(this, appIdentifier, targetTypes, targetValues, issuedAt); |
| 3093 | + } catch (SQLException e) { |
| 3094 | + throw new StorageQueryException(e); |
| 3095 | + } |
| 3096 | + } |
| 3097 | + |
| 3098 | + @Override |
| 3099 | + public void addM2MToken(AppIdentifier appIdentifier, String clientId, long iat, long exp) |
| 3100 | + throws StorageQueryException { |
| 3101 | + try { |
| 3102 | + OAuthQueries.addM2MToken(this, appIdentifier, clientId, iat, exp); |
| 3103 | + } catch (SQLException e) { |
| 3104 | + throw new StorageQueryException(e); |
| 3105 | + } |
| 3106 | + } |
| 3107 | + |
| 3108 | + @Override |
| 3109 | + public void addLogoutChallenge(AppIdentifier appIdentifier, String challenge, String clientId, |
| 3110 | + String postLogoutRedirectionUri, String sessionHandle, String state, long timeCreated) throws StorageQueryException { |
| 3111 | + try { |
| 3112 | + OAuthQueries.addLogoutChallenge(this, appIdentifier, challenge, clientId, postLogoutRedirectionUri, sessionHandle, state, timeCreated); |
| 3113 | + } catch (SQLException e) { |
| 3114 | + throw new StorageQueryException(e); |
| 3115 | + } |
| 3116 | + } |
| 3117 | + |
| 3118 | + @Override |
| 3119 | + public OAuthLogoutChallenge getLogoutChallenge(AppIdentifier appIdentifier, String challenge) |
| 3120 | + throws StorageQueryException { |
| 3121 | + try { |
| 3122 | + return OAuthQueries.getLogoutChallenge(this, appIdentifier, challenge); |
| 3123 | + } catch (SQLException e) { |
| 3124 | + throw new StorageQueryException(e); |
| 3125 | + } |
| 3126 | + } |
| 3127 | + |
| 3128 | + @Override |
| 3129 | + public void deleteLogoutChallenge(AppIdentifier appIdentifier, String challenge) throws StorageQueryException { |
| 3130 | + try { |
| 3131 | + OAuthQueries.deleteLogoutChallenge(this, appIdentifier, challenge); |
| 3132 | + } catch (SQLException e) { |
| 3133 | + throw new StorageQueryException(e); |
| 3134 | + } |
| 3135 | + } |
| 3136 | + |
| 3137 | + @Override |
| 3138 | + public void deleteLogoutChallengesBefore(AppIdentifier appIdentifier, long time) throws StorageQueryException { |
| 3139 | + try { |
| 3140 | + OAuthQueries.deleteLogoutChallengesBefore(this, appIdentifier, time); |
| 3141 | + } catch (SQLException e) { |
| 3142 | + throw new StorageQueryException(e); |
| 3143 | + } |
| 3144 | + } |
| 3145 | + |
| 3146 | + @Override |
| 3147 | + public void cleanUpExpiredAndRevokedTokens(AppIdentifier appIdentifier) throws StorageQueryException { |
| 3148 | + try { |
| 3149 | + OAuthQueries.cleanUpExpiredAndRevokedTokens(this, appIdentifier); |
| 3150 | + } catch (SQLException e) { |
| 3151 | + throw new StorageQueryException(e); |
| 3152 | + } |
| 3153 | + } |
| 3154 | + |
| 3155 | + @Override |
| 3156 | + public int countTotalNumberOfM2MTokensAlive(AppIdentifier appIdentifier) throws StorageQueryException { |
| 3157 | + try { |
| 3158 | + return OAuthQueries.countTotalNumberOfM2MTokensAlive(this, appIdentifier); |
| 3159 | + } catch (SQLException e) { |
| 3160 | + throw new StorageQueryException(e); |
| 3161 | + } |
| 3162 | + } |
| 3163 | + |
| 3164 | + @Override |
| 3165 | + public int countTotalNumberOfM2MTokensCreatedSince(AppIdentifier appIdentifier, long since) |
| 3166 | + throws StorageQueryException { |
| 3167 | + try { |
| 3168 | + return OAuthQueries.countTotalNumberOfM2MTokensCreatedSince(this, appIdentifier, since); |
| 3169 | + } catch (SQLException e) { |
| 3170 | + throw new StorageQueryException(e); |
| 3171 | + } |
| 3172 | + } |
| 3173 | + |
| 3174 | + @Override |
| 3175 | + public int countTotalNumberOfClientCredentialsOnlyClientsForApp(AppIdentifier appIdentifier) |
| 3176 | + throws StorageQueryException { |
| 3177 | + try { |
| 3178 | + return OAuthQueries.countTotalNumberOfClientsForApp(this, appIdentifier, true); |
| 3179 | + } catch (SQLException e) { |
| 3180 | + throw new StorageQueryException(e); |
| 3181 | + } |
| 3182 | + } |
| 3183 | + |
| 3184 | + @Override |
| 3185 | + public int countTotalNumberOfClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException { |
| 3186 | + try { |
| 3187 | + return OAuthQueries.countTotalNumberOfClientsForApp(this, appIdentifier, false); |
| 3188 | + } catch (SQLException e) { |
| 3189 | + throw new StorageQueryException(e); |
| 3190 | + } |
| 3191 | + } |
| 3192 | + |
| 3193 | + |
3037 | 3194 | public static boolean isEnabledForDeadlockTesting() {
|
3038 | 3195 | return enableForDeadlockTesting;
|
3039 | 3196 | }
|
|
0 commit comments