-
Notifications
You must be signed in to change notification settings - Fork 544
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
Feature remove registry SAML #6197
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6197 +/- ##
============================================
+ Coverage 45.66% 45.90% +0.23%
- Complexity 14040 14352 +312
============================================
Files 1632 1640 +8
Lines 100532 102823 +2291
Branches 17421 16885 -536
============================================
+ Hits 45911 47198 +1287
- Misses 47931 48815 +884
- Partials 6690 6810 +120
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
9833bf2
to
33847a3
Compare
...ty.core/src/main/java/org/wso2/carbon/identity/core/dao/SAMLSSOServiceProviderConstants.java
Outdated
Show resolved
Hide resolved
...ty.core/src/main/java/org/wso2/carbon/identity/core/dao/SAMLSSOServiceProviderConstants.java
Show resolved
Hide resolved
PR builder started |
PR builder completed |
import static org.wso2.carbon.identity.core.dao.SAMLSSOServiceProviderConstants.SAML2TableColumns.PROPERTY_VALUE; | ||
import static org.wso2.carbon.identity.core.dao.SAMLSSOServiceProviderConstants.SAML2TableColumns.SP_ID; | ||
|
||
public class JDBCSAMLSSOServiceProviderDAOImpl implements SAMLSSOServiceProviderDAO { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a class comment.
|
||
public class JDBCSAMLSSOServiceProviderDAOImpl implements SAMLSSOServiceProviderDAO { | ||
|
||
private static final Log log = LogFactory.getLog(JDBCSAMLSSOServiceProviderDAOImpl.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final Log log = LogFactory.getLog(JDBCSAMLSSOServiceProviderDAOImpl.class); | |
private static final Log LOG = LogFactory.getLog(JDBCSAMLSSOServiceProviderDAOImpl.class); |
public class JDBCSAMLSSOServiceProviderDAOImpl implements SAMLSSOServiceProviderDAO { | ||
|
||
private static final Log log = LogFactory.getLog(JDBCSAMLSSOServiceProviderDAOImpl.class); | ||
private int tenantId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this instance variable? Having a instance variable for tenantId
is could lead to lot of issues when same object are reused across many tenants.
private static final String QUERY_TO_GET_APPLICATION_CERTIFICATE_ID = "SELECT " + | ||
"META.VALUE FROM SP_INBOUND_AUTH INBOUND, SP_APP SP, SP_METADATA META WHERE SP.ID = INBOUND.APP_ID AND " + | ||
"SP.ID = META.SP_ID AND META.NAME = ? AND INBOUND.INBOUND_AUTH_KEY = ? AND META.TENANT_ID = ?"; | ||
private static final String QUERY_TO_GET_APPLICATION_CERTIFICATE_ID_H2 = "SELECT " + | ||
"META.`VALUE` FROM SP_INBOUND_AUTH INBOUND, SP_APP SP, SP_METADATA META WHERE SP.ID = INBOUND.APP_ID AND " + | ||
"SP.ID = META.SP_ID AND META.NAME = ? AND INBOUND.INBOUND_AUTH_KEY = ? AND META.TENANT_ID = ?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't access the SP_
tables directly
return certificateId != null ? certificateId : -1; | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line
SAMLSSOServiceProviderDAO serviceProviderDAO = new SAMLSSOServiceProviderDAO(registry); | ||
return serviceProviderDAO.addServiceProvider(serviceProviderDO); | ||
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); | ||
SAMLSSOServiceProviderDAO serviceProviderDAO = new RegistrySAMLSSOServiceProviderDAOImpl(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change this to use Factory.
…nts to use named parameters
"META.`VALUE` FROM SP_INBOUND_AUTH INBOUND, SP_APP SP, SP_METADATA META WHERE SP.ID = INBOUND.APP_ID AND " + | ||
"SP.ID = META.SP_ID AND META.NAME = ? AND INBOUND.INBOUND_AUTH_KEY = ? AND META.TENANT_ID = ?"; | ||
|
||
private static Log log = LogFactory.getLog(SAMLSSOServiceProviderDAO.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static Log log = LogFactory.getLog(SAMLSSOServiceProviderDAO.class); | |
private static Log log = LogFactory.getLog(RegistrySAMLSSOServiceProviderDAOImpl.class); |
...y.core/src/main/java/org/wso2/carbon/identity/core/dao/SAMLSSOPersistenceManagerFactory.java
Show resolved
Hide resolved
private static final String HYBRID = "hybrid"; | ||
private static final String REGISTRY = "registry"; | ||
|
||
public SAMLSSOServiceProviderDAO buildSSOServiceProviderManager(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting
6d89915
to
1d8ffdd
Compare
break; | ||
case REGISTRY: | ||
samlSSOServiceProviderDAO = new RegistrySAMLSSOServiceProviderDAOImpl(); | ||
LOG.info("Registry based SAML storage initialized."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change this to warn log
...y.core/src/main/java/org/wso2/carbon/identity/core/dao/SAMLSSOPersistenceManagerFactory.java
Show resolved
Hide resolved
8313f3f
to
914a7de
Compare
914a7de
to
4b9f7e5
Compare
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
Proposed changes in this pull request
This is raised early in the development to validate incremental improvements done on the feature branch to test against the product-is integration tests using the pr builder action
When should this PR be merged
This is a draft PR. Do not merge this.