-
Notifications
You must be signed in to change notification settings - Fork 539
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
Add IdentityKeyStoreResolver and Util Classes #5794
base: master
Are you sure you want to change the base?
Conversation
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...identity.core/src/main/java/org/wso2/carbon/identity/core/model/IdentityKeyStoreMapping.java
Outdated
Show resolved
Hide resolved
...identity.core/src/main/java/org/wso2/carbon/identity/core/model/IdentityKeyStoreMapping.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Show resolved
Hide resolved
...tity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtil.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Show resolved
Hide resolved
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
<TrustManagerType>{{key_mgt.trust_manager_type}}</TrustManagerType> | ||
{% if identity.keystore.mapping is defined %} | ||
|
||
<CustomKeyStoreMappings> | ||
{% for mapping in identity.keystore.mapping %} | ||
<KeyStoreMapping> |
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.
<TrustManagerType>{{key_mgt.trust_manager_type}}</TrustManagerType> | |
{% if identity.keystore.mapping is defined %} | |
<CustomKeyStoreMappings> | |
{% for mapping in identity.keystore.mapping %} | |
<KeyStoreMapping> | |
<TrustManagerType>{{key_mgt.trust_manager_type}}</TrustManagerType> | |
{% if identity.keystore.mapping is defined %} | |
<CustomKeyStoreMappings> | |
{% for mapping in identity.keystore.mapping %} | |
<KeyStoreMapping> |
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.
This new line is there to separate the 2 types of configurations
Ex:
<!-- Security configurations -->
<Security>
<!-- The directory under which all other KeyStore files will be stored -->
<KeyStoresDir>${carbon.home}/conf/keystores</KeyStoresDir>
<KeyManagerType>SunX509</KeyManagerType>
<TrustManagerType>SunX509</TrustManagerType>
<CustomKeyStoreMappings>
<KeyStoreMapping>
<Protocol>oauth</Protocol>
Should I remove this?
....core/src/test/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtilTest.java
Outdated
Show resolved
Hide resolved
....core/src/test/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtilTest.java
Show resolved
Hide resolved
....core/src/test/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtilTest.java
Outdated
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Outdated
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Outdated
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Outdated
Show resolved
Hide resolved
...rbon.identity.core/src/main/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolver.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverConstants.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverException.java
Show resolved
Hide resolved
...tity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtil.java
Show resolved
Hide resolved
...tity.core/src/main/java/org/wso2/carbon/identity/core/util/IdentityKeyStoreResolverUtil.java
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Outdated
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Show resolved
Hide resolved
....identity.core/src/test/java/org/wso2/carbon/identity/core/IdentityKeyStoreResolverTest.java
Show resolved
Hide resolved
assertEquals(tenantCertificate, identityKeyStoreResolver.getCertificate(TENANT_DOMAIN, InboundProtocol.WS_TRUST)); | ||
} | ||
|
||
private void setFinalStatic(Field field, Object newValue) throws Exception { |
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.
Can you please explain the use of this method
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.
Used this method to set values to private static variables in IdentityKeyStoreResolver
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.
Improved by moving the logic to setPrivateStaticField
method
@@ -28,6 +28,7 @@ | |||
<class name="org.wso2.carbon.identity.core.internal.DefaultServiceURLBuilderTest"/> | |||
<class name="org.wso2.carbon.identity.core.cache.BaseCacheTest"/> | |||
<class name="org.wso2.carbon.identity.core.ThreadLocalAwareThreadPoolExecutorTest"/> | |||
<class name="org.wso2.carbon.identity.core.IdentityKeyStoreResolverTest"/> |
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.
What about the util test class?
keyStoreMappings.put(InboundProtocol.OAUTH, oauthKeyStoreMapping); | ||
keyStoreMappings.put(InboundProtocol.WS_TRUST, wsTrustKeyStoreMapping); | ||
|
||
setPrivateStaticField(IdentityKeyStoreResolver.class, "keyStoreMappings", keyStoreMappings); |
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.
don't we have a setter method to set values for this attribute?
Purpose
IdentityKeyStoreResolver
class and related util classes.IdentityKeyStoreResolver
class will resolve correct KeyStores, Certificates, and Keys that are to be used in authentication protocols.deployment.toml
configurationImportant