-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hydra integration for auth, token and few more endpoints (#1032)
* fix: auth and token api * fix: cookie and code transformations * fix: token re-signing * fix: token endpoint * fix: license check and jwks caching * fix: exceptions * fix: refactor * fix: refactor * fix: refactor and client crud APIs * fix: token type enum * fix: process ext only on access token * fix: refactor * fix: bugs and refactor * fix: oauth clients list api * fix: consent get accept and reject * fix: login request * fix: query param transformation * fix: logout request * fix: refactor * fix: remove error debug and hint * fix: introspect api * fix: pr comments * fix: pr comments * fix: pr comment * fix: pr comment * fix: pr comments and refactor * fix: pr comments * fix: pr comments * fix: revert original http request * fix: pr comment refactor * fix: pr comment * fix: pr comment * fix: pr comment * fix: pr comments * fix: owner and pagination * fix: pr comment * fix: client id check * fix: ext related * fix: pr comment * fix: revoke APIs (#1041) * fix: revoke consent sessions * fix: revoke token * fix: revoke impl * fix: revoke session * fix: introspect impl after revoke * fix: revoke by client_id * fix: refresh token check in token exchange * fix: at hash * fix: sqlite impl * fix: client props whitelist * fix: status and query null check * fix: plugin interface update * fix: logout api * fix: ext * fix: accept consent * fix: accept consent * fix: introspect in token api * fix: keep fragment while updating query params * fix: count creds and pr comment * fix: oauth stats * fix: oauth cleanup cron task * fix: gid in refresh token * fix: inememory impl * feat: add initial payload fields to accept consent * fix: revoke cleanup * fix: stats * fix: client credentials basic * fix: authorization header * fix: authorizaion header in revoke * fix: missing table --------- Co-authored-by: Mihaly Lengyel <[email protected]> --------- Co-authored-by: Mihaly Lengyel <[email protected]>
- Loading branch information
Showing
48 changed files
with
4,025 additions
and
1,336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/io/supertokens/cronjobs/cleanupOAuthRevokeList/CleanupOAuthRevokeList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package io.supertokens.cronjobs.cleanupOAuthRevokeList; | ||
|
||
import java.util.List; | ||
|
||
import io.supertokens.Main; | ||
import io.supertokens.cronjobs.CronTask; | ||
import io.supertokens.cronjobs.CronTaskTest; | ||
import io.supertokens.pluginInterface.Storage; | ||
import io.supertokens.pluginInterface.StorageUtils; | ||
import io.supertokens.pluginInterface.multitenancy.AppIdentifier; | ||
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier; | ||
import io.supertokens.pluginInterface.oauth.OAuthStorage; | ||
import io.supertokens.storageLayer.StorageLayer; | ||
|
||
public class CleanupOAuthRevokeList extends CronTask { | ||
|
||
public static final String RESOURCE_KEY = "io.supertokens.cronjobs.cleanupOAuthRevokeList" + | ||
".CleanupOAuthRevokeList"; | ||
|
||
private CleanupOAuthRevokeList(Main main, List<List<TenantIdentifier>> tenantsInfo) { | ||
super("CleanupOAuthRevokeList", main, tenantsInfo, true); | ||
} | ||
|
||
public static CleanupOAuthRevokeList init(Main main, List<List<TenantIdentifier>> tenantsInfo) { | ||
return (CleanupOAuthRevokeList) main.getResourceDistributor() | ||
.setResource(new TenantIdentifier(null, null, null), RESOURCE_KEY, | ||
new CleanupOAuthRevokeList(main, tenantsInfo)); | ||
} | ||
|
||
@Override | ||
protected void doTaskPerApp(AppIdentifier app) throws Exception { | ||
Storage storage = StorageLayer.getStorage(app.getAsPublicTenantIdentifier(), main); | ||
OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); | ||
oauthStorage.cleanUpExpiredAndRevokedTokens(app); | ||
} | ||
|
||
@Override | ||
public int getIntervalTimeSeconds() { | ||
if (Main.isTesting) { | ||
Integer interval = CronTaskTest.getInstance(main).getIntervalInSeconds(RESOURCE_KEY); | ||
if (interval != null) { | ||
return interval; | ||
} | ||
} | ||
// Every 24 hours. | ||
return 24 * 3600; | ||
} | ||
|
||
@Override | ||
public int getInitialWaitTimeSeconds() { | ||
if (!Main.isTesting) { | ||
return getIntervalTimeSeconds(); | ||
} else { | ||
return 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.