Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not cache disabled tokens #7061

Merged
merged 29 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3279481
Deactivated records should get 409 on GET requests
amontenegro Feb 27, 2024
b3660c2
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Feb 28, 2024
2cc66ab
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 1, 2024
f2dc713
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 4, 2024
b4f8223
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 7, 2024
b0026c3
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 12, 2024
53e7616
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 19, 2024
bf82372
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Mar 25, 2024
23b6afb
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 4, 2024
182c67d
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 4, 2024
c52ef13
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 8, 2024
d4f779b
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 8, 2024
27b0033
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 17, 2024
585b896
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Apr 18, 2024
9c9dfef
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro May 8, 2024
42ac636
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro May 28, 2024
3f0d771
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jun 10, 2024
e65ec79
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jun 20, 2024
e69191a
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jun 24, 2024
cff8029
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 3, 2024
ddf3e67
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 4, 2024
a091bb3
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 5, 2024
97024f0
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 15, 2024
3201e7e
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 18, 2024
c85de91
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 22, 2024
3132245
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Jul 30, 2024
3672cfd
Merge branch 'main' of https://github.com/ORCID/ORCID-Source
amontenegro Aug 6, 2024
04c185a
Do not cache the token if it id disabled, since the token does not kn…
amontenegro Aug 6, 2024
d6027d8
Remove unused imports
amontenegro Aug 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Deactivated records should get 409 on GET requests
  • Loading branch information
amontenegro committed Feb 27, 2024
commit 327948179e7bbe26605e09d6ecfe906e1cc546e0
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public Response toResponse(Throwable t) {
logShortError(t, clientId);
} else if (t instanceof LockedException) {
logShortError(t, clientId);
} else if (t instanceof DeactivatedException) {
logShortError(t, clientId);
} else if (t instanceof ClientDeactivatedException) {
logShortError(t, clientId);
} else if (t instanceof OrcidNonPublicElementException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1642,16 +1642,8 @@ public Response deleteResearchResource(String orcid, Long putCode) {
return Response.noContent().build();
}

private void checkProfileStatus(String orcid, boolean readOperation) {
try {
orcidSecurityManager.checkProfile(orcid);
} catch (DeactivatedException e) {
// If it is a read operation, ignore the deactivated status since we
// are going to return the empty element with the deactivation date
if (!readOperation) {
throw e;
}
}
private void checkProfileStatus(String orcid, boolean readOperation) throws DeactivatedException {
orcidSecurityManager.checkProfile(orcid);
}

private Map<String, String> addParmsMismatchedPutCode(Long urlPutCode, Long bodyPutCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ public void checkProfile(String orcid) throws NoResultException, OrcidDeprecated

// Check if the user record is locked
if (!profile.isAccountNonLocked()) {
LockedException lockedException = new LockedException();
LockedException lockedException = new LockedException(orcid + " is locked");
lockedException.setOrcid(profile.getId());
throw lockedException;
}

// Check if the user record is deactivated
if (profile.getDeactivationDate() != null) {
DeactivatedException exception = new DeactivatedException();
exception.setOrcid(orcid);
DeactivatedException exception = new DeactivatedException(orcid + " is deactivated");
exception.setOrcid(orcid);
throw exception;
}
}
Expand Down
Loading