@@ -3101,33 +3101,6 @@ public int countUsersThatHaveMoreThanOneLoginMethodOrTOTPEnabledAndActiveSince(A
31013101 }
31023102 }
31033103
3104- @ Override
3105- public boolean doesOAuthClientIdExist (AppIdentifier appIdentifier , String clientId )
3106- throws StorageQueryException {
3107- try {
3108- return OAuthQueries .doesOAuthClientIdExist (this , clientId , appIdentifier );
3109- } catch (SQLException e ) {
3110- throw new StorageQueryException (e );
3111- }
3112- }
3113-
3114- @ Override
3115- public void addOrUpdateOauthClient (AppIdentifier appIdentifier , String clientId , boolean isClientCredentialsOnly )
3116- throws StorageQueryException , TenantOrAppNotFoundException {
3117- try {
3118- OAuthQueries .addOrUpdateOauthClient (this , appIdentifier , clientId , isClientCredentialsOnly );
3119- } catch (SQLException e ) {
3120- PostgreSQLConfig config = Config .getConfig (this );
3121- if (e instanceof PSQLException ) {
3122- ServerErrorMessage serverMessage = ((PSQLException ) e ).getServerErrorMessage ();
3123-
3124- if (isForeignKeyConstraintError (serverMessage , config .getOAuthClientsTable (), "app_id" )) {
3125- throw new TenantOrAppNotFoundException (appIdentifier );
3126- }
3127- }
3128- throw new StorageQueryException (e );
3129- }
3130- }
31313104
31323105 @ Override
31333106 public boolean deleteOAuthClient (AppIdentifier appIdentifier , String clientId ) throws StorageQueryException {
@@ -3138,156 +3111,7 @@ public boolean deleteOAuthClient(AppIdentifier appIdentifier, String clientId) t
31383111 }
31393112 }
31403113
3141- @ Override
3142- public List <String > listOAuthClients (AppIdentifier appIdentifier ) throws StorageQueryException {
3143- try {
3144- return OAuthQueries .listOAuthClients (this , appIdentifier );
3145- } catch (SQLException e ) {
3146- throw new StorageQueryException (e );
3147- }
3148- }
3149-
3150- @ Override
3151- public void revokeOAuthTokensBasedOnTargetFields (AppIdentifier appIdentifier , OAuthRevokeTargetType targetType , String targetValue , long exp )
3152- throws StorageQueryException , TenantOrAppNotFoundException {
3153- try {
3154- OAuthQueries .revokeOAuthTokensBasedOnTargetFields (this , appIdentifier , targetType , targetValue , exp );
3155- } catch (SQLException e ) {
3156- PostgreSQLConfig config = Config .getConfig (this );
3157- if (e instanceof PSQLException ) {
3158- ServerErrorMessage serverMessage = ((PSQLException ) e ).getServerErrorMessage ();
3159-
3160- if (isForeignKeyConstraintError (serverMessage , config .getOAuthRevokeTable (), "app_id" )) {
3161- throw new TenantOrAppNotFoundException (appIdentifier );
3162- }
3163- }
3164- throw new StorageQueryException (e );
3165- }
3166-
3167- }
3168-
3169- @ Override
3170- public boolean isOAuthTokenRevokedBasedOnTargetFields (AppIdentifier appIdentifier , OAuthRevokeTargetType [] targetTypes , String [] targetValues , long issuedAt )
3171- throws StorageQueryException {
3172- try {
3173- return OAuthQueries .isOAuthTokenRevokedBasedOnTargetFields (this , appIdentifier , targetTypes , targetValues , issuedAt );
3174- } catch (SQLException e ) {
3175- throw new StorageQueryException (e );
3176- }
3177- }
3178-
3179- @ Override
3180- public void addOAuthM2MTokenForStats (AppIdentifier appIdentifier , String clientId , long iat , long exp )
3181- throws StorageQueryException , OAuthClientNotFoundException {
3182- try {
3183- OAuthQueries .addOAuthM2MTokenForStats (this , appIdentifier , clientId , iat , exp );
3184- } catch (SQLException e ) {
3185- PostgreSQLConfig config = Config .getConfig (this );
3186- if (e instanceof PSQLException ) {
3187- ServerErrorMessage serverMessage = ((PSQLException ) e ).getServerErrorMessage ();
31883114
3189- if (isForeignKeyConstraintError (serverMessage , config .getOAuthM2MTokensTable (), "client_id" )) {
3190- throw new OAuthClientNotFoundException ();
3191- }
3192- }
3193- throw new StorageQueryException (e );
3194- }
3195- }
3196-
3197- @ Override
3198- public void cleanUpExpiredAndRevokedOAuthTokensList () throws StorageQueryException {
3199- try {
3200- OAuthQueries .cleanUpExpiredAndRevokedOAuthTokensList (this );
3201- } catch (SQLException e ) {
3202- throw new StorageQueryException (e );
3203- }
3204- }
3205-
3206- @ Override
3207- public void addOAuthLogoutChallenge (AppIdentifier appIdentifier , String challenge , String clientId ,
3208- String postLogoutRedirectionUri , String sessionHandle , String state , long timeCreated )
3209- throws StorageQueryException , DuplicateOAuthLogoutChallengeException , OAuthClientNotFoundException {
3210- try {
3211- OAuthQueries .addOAuthLogoutChallenge (this , appIdentifier , challenge , clientId , postLogoutRedirectionUri , sessionHandle , state , timeCreated );
3212- } catch (SQLException e ) {
3213- PostgreSQLConfig config = Config .getConfig (this );
3214- if (e instanceof PSQLException ) {
3215- ServerErrorMessage serverMessage = ((PSQLException ) e ).getServerErrorMessage ();
3216-
3217- if (isPrimaryKeyError (serverMessage , config .getOAuthLogoutChallengesTable ())) {
3218- throw new DuplicateOAuthLogoutChallengeException ();
3219- } else if (isForeignKeyConstraintError (serverMessage , config .getOAuthLogoutChallengesTable (), "client_id" )) {
3220- throw new OAuthClientNotFoundException ();
3221- }
3222- }
3223- throw new StorageQueryException (e );
3224- }
3225- }
3226-
3227- @ Override
3228- public OAuthLogoutChallenge getOAuthLogoutChallenge (AppIdentifier appIdentifier , String challenge ) throws StorageQueryException {
3229- try {
3230- return OAuthQueries .getOAuthLogoutChallenge (this , appIdentifier , challenge );
3231- } catch (SQLException e ) {
3232- throw new StorageQueryException (e );
3233- }
3234- }
3235-
3236- @ Override
3237- public void deleteOAuthLogoutChallenge (AppIdentifier appIdentifier , String challenge ) throws StorageQueryException {
3238- try {
3239- OAuthQueries .deleteOAuthLogoutChallenge (this , appIdentifier , challenge );
3240- } catch (SQLException e ) {
3241- throw new StorageQueryException (e );
3242- }
3243- }
3244-
3245- @ Override
3246- public void deleteOAuthLogoutChallengesBefore (long time ) throws StorageQueryException {
3247- try {
3248- OAuthQueries .deleteOAuthLogoutChallengesBefore (this , time );
3249- } catch (SQLException e ) {
3250- throw new StorageQueryException (e );
3251- }
3252- }
3253-
3254- @ Override
3255- public int countTotalNumberOfOAuthClients (AppIdentifier appIdentifier ) throws StorageQueryException {
3256- try {
3257- return OAuthQueries .countTotalNumberOfClients (this , appIdentifier , false );
3258- } catch (SQLException e ) {
3259- throw new StorageQueryException (e );
3260- }
3261- }
3262-
3263- @ Override
3264- public int countTotalNumberOfClientCredentialsOnlyOAuthClients (AppIdentifier appIdentifier )
3265- throws StorageQueryException {
3266- try {
3267- return OAuthQueries .countTotalNumberOfClients (this , appIdentifier , true );
3268- } catch (SQLException e ) {
3269- throw new StorageQueryException (e );
3270- }
3271- }
3272-
3273- @ Override
3274- public int countTotalNumberOfOAuthM2MTokensCreatedSince (AppIdentifier appIdentifier , long since )
3275- throws StorageQueryException {
3276- try {
3277- return OAuthQueries .countTotalNumberOfOAuthM2MTokensCreatedSince (this , appIdentifier , since );
3278- } catch (SQLException e ) {
3279- throw new StorageQueryException (e );
3280- }
3281- }
3282-
3283- @ Override
3284- public int countTotalNumberOfOAuthM2MTokensAlive (AppIdentifier appIdentifier ) throws StorageQueryException {
3285- try {
3286- return OAuthQueries .countTotalNumberOfOAuthM2MTokensAlive (this , appIdentifier );
3287- } catch (SQLException e ) {
3288- throw new StorageQueryException (e );
3289- }
3290- }
32913115
32923116 @ TestOnly
32933117 public int getDbActivityCount (String dbname ) throws SQLException , StorageQueryException {
@@ -3335,15 +3159,6 @@ public void addOrUpdateOauthClient(AppIdentifier appIdentifier, String clientId,
33353159 }
33363160 }
33373161
3338- @ Override
3339- public boolean deleteOAuthClient (AppIdentifier appIdentifier , String clientId ) throws StorageQueryException {
3340- try {
3341- return OAuthQueries .deleteOAuthClient (this , clientId , appIdentifier );
3342- } catch (SQLException e ) {
3343- throw new StorageQueryException (e );
3344- }
3345- }
3346-
33473162 @ Override
33483163 public List <OAuthClient > getOAuthClients (AppIdentifier appIdentifier , List <String > clientIds ) throws StorageQueryException {
33493164 try {
0 commit comments