-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add updates to spring security config (#10549)
* Add updates to spring security config * Add back InactiveCacheMap and add optional_oauth2 to AutoCofigExclude class * Fix DataAccessTokenController Test * Copy Application Properties for Integration Test * Update LoginController to have support for post and get * Add Custom Authorization and force oauth2 through login page... redirects to single idp if there is only one * Fix CacheMap Annotations * Force Method Auth if using oauth2 or saml * Add UUID Token AuthenticationProvider * Update to make method_authorization property only applicable when optional_oauth2 is set * Add Redirect when one idp is set * Fix Sonar issues * Remove unused imports * 🐛 fix SAML2 Config
- Loading branch information
Showing
22 changed files
with
240 additions
and
316 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
39 changes: 39 additions & 0 deletions
39
src/main/java/org/cbioportal/persistence/cachemaputil/InactiveCacheMapUtil.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,39 @@ | ||
package org.cbioportal.persistence.cachemaputil; | ||
|
||
import org.cbioportal.model.CancerStudy; | ||
import org.cbioportal.model.MolecularProfile; | ||
import org.cbioportal.model.SampleList; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Map; | ||
|
||
@Component | ||
// This implementation of the CacheMapUtils is instantiated on portals where all uses can access any study. | ||
@ConditionalOnExpression("'false' eq '${authenticate}' or ('optional_oauth2' eq '${authenticate}' and 'true' ne '${security.method_authorization_enabled}')") | ||
public class InactiveCacheMapUtil implements CacheMapUtil { | ||
|
||
// Since user-permission evaluation is not needed when this bean is present, throw an error when it is accessed. | ||
|
||
@Override | ||
public Map<String, MolecularProfile> getMolecularProfileMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
@Override | ||
public Map<String, SampleList> getSampleListMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
@Override | ||
public Map<String, CancerStudy> getCancerStudyMap() { | ||
throw new RuntimeException("A CacheMapUtils method was called on a portal where studies are accessible to all users."); | ||
} | ||
|
||
// bean is only instantiated when there is no user authorization | ||
@Override | ||
public boolean hasCacheEnabled() { | ||
return false; | ||
} | ||
|
||
} |
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
37 changes: 0 additions & 37 deletions
37
src/main/java/org/cbioportal/security/CustomJwtGrantedAuthoritiesConverter.java
This file was deleted.
Oops, something went wrong.
86 changes: 0 additions & 86 deletions
86
src/main/java/org/cbioportal/security/UuidBearerTokenAuthenticationFilter.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.