Skip to content

Commit

Permalink
fix: oauth plugin interface updates (#160)
Browse files Browse the repository at this point in the history
* fix: revoke

* fix: pr comments

* fix: oauth storage

* fix: update

* fix: add m2m token

* fix: revoke and cleanup
  • Loading branch information
sattvikc authored Sep 25, 2024
1 parent 8654dd9 commit 1224ca8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,33 @@
import io.supertokens.pluginInterface.exceptions.StorageQueryException;
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
import io.supertokens.pluginInterface.nonAuthRecipe.NonAuthRecipeStorage;
import io.supertokens.pluginInterface.oauth.exceptions.OAuth2ClientAlreadyExistsForAppException;

import java.util.List;

public interface OAuthStorage extends NonAuthRecipeStorage {

public boolean doesClientIdExistForThisApp(AppIdentifier appIdentifier, String clientId) throws
public boolean doesClientIdExistForApp(AppIdentifier appIdentifier, String clientId) throws
StorageQueryException;

public void addClientForApp(AppIdentifier appIdentifier, String clientId) throws StorageQueryException,
OAuth2ClientAlreadyExistsForAppException;
public void addOrUpdateClientForApp(AppIdentifier appIdentifier, String clientId, boolean isClientCredentialsOnly) throws StorageQueryException;

public boolean removeAppClientAssociation(AppIdentifier appIdentifier, String clientId) throws StorageQueryException;

List<String> listClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException;
public List<String> listClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException;

public void revoke(AppIdentifier appIdentifier, String targetType, String targetValue, long exp) throws StorageQueryException;

public boolean isRevoked(AppIdentifier appIdentifier, String[] targetTypes, String[] targetValues, long issuedAt) throws StorageQueryException;

public void addM2MToken(AppIdentifier appIdentifier, String clientId, long iat, long exp) throws StorageQueryException;

public int countTotalNumberOfClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException;

public int countTotalNumberOfClientCredentialsOnlyClientsForApp(AppIdentifier appIdentifier) throws StorageQueryException;

public int countTotalNumberOfM2MTokensCreatedSince(AppIdentifier appIdentifier, long since) throws StorageQueryException;

public int countTotalNumberOfM2MTokensAlive(AppIdentifier appIdentifier) throws StorageQueryException;

public void cleanUpExpiredAndRevokedTokens(AppIdentifier appIdentifier) throws StorageQueryException;
}

This file was deleted.

0 comments on commit 1224ca8

Please sign in to comment.