Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit ecee9b0

Browse files
committed
Renamed UserSource/Service to identity store
1 parent 763a6df commit ecee9b0

24 files changed

Lines changed: 195 additions & 94 deletions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# user-and-role-service
2+
3+
https://java.net/jira/browse/JAVAEE_SECURITY_SPEC-10
4+
5+
From: Alex Kosowski (edited by Arjan Tijms)
6+
7+
START Evaluation by Arjan Tijms
8+
9+
This proposal models primarily a mutable identity store with many operations. Most of those operations go far beyond the minimal {credentials in/identity out} that containers themselves call.
10+
11+
The identity store is represented by the IdentityStore interface. There are definition (factory) annotations for various standardized implementations. Usage of these annotations by
12+
applications will cause an IdentityStore implementation to be made available via JNDI.
13+
14+
The {identity out} part of the {credentials in/identity out} function comes from the UserInfo class that is returned by IdentityStore#loadUserByUsername.
15+
16+
The {credentials in} part of the {credentials in/identity out} function is not shown in this proposal.
17+
18+
This proposal also models a role mapper, which largely follows the same pattern as the identity store.
19+
20+
Finally, the proposal seems to model an authentication mechanism (orginally called authenticator). TODO: I'm not 100% if this indeed models an authentication mechanism such as a JASPIC SAM
21+
does.
22+
23+
24+
END Evaluation by Arjan Tijms
25+
26+
27+
The IdentityStore annotations would be an adapter between the repository and the IdentityStore interface. We would standardize IdentityStore implementations for various repository types (LDAP, DataSource,

user-and-role-service/pom.xml renamed to identity-store-jndi-with-rolemapper/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
<version>1.0-SNAPSHOT</version>
2626
</parent>
2727

28-
<artifactId>user-and-role-service</artifactId>
28+
<artifactId>identity-store-jndi-with-rolemapper</artifactId>
2929

3030
</project>

user-and-role-service/src/main/java/javax/security/auth/Authenticator.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/AuthenticationMechanism.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package javax.security.auth;
22

3-
public @interface Authenticator {
3+
public @interface AuthenticationMechanism {
44
String userSourceName();
55

66
String roleMapperName();

user-and-role-service/src/main/java/javax/security/auth/user/CustomUserSourceDefinition.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/CustomIdentityStoreDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
23+
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
2329

2430
/**
2531
* Application definable
2632
*/
27-
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
28-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
29-
public @interface CustomUserSourceDefinition {
33+
@Target({TYPE})
34+
@Retention(RUNTIME)
35+
public @interface CustomIdentityStoreDefinition {
3036
String name();
3137
}

user-and-role-service/src/main/java/javax/security/auth/user/DataSourceUserSourceDefinition.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/DataSourceIdentityStoreDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
23+
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
2329

2430
/**
2531
* Points to an application supplied DataSource
2632
*/
27-
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
28-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
29-
public @interface DataSourceUserSourceDefinition {
33+
@Target({TYPE})
34+
@Retention(RUNTIME)
35+
public @interface DataSourceIdentityStoreDefinition {
3036
String name();
3137
}

user-and-role-service/src/main/java/javax/security/auth/user/UserService.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/IdentityStore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
2323

2424
import java.util.List;
2525

26-
public interface UserService {
26+
public interface IdentityStore {
2727

2828
UserInfo loadUserByUsername(String username);
2929

user-and-role-service/src/main/java/javax/security/auth/user/Jsr351UserSourceDefinition.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/Jsr351IdentityStoreDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
23+
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
2329

2430
/**
2531
* Bridges to the JSR 351 Identity API
2632
*/
27-
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
28-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
29-
public @interface Jsr351UserSourceDefinition {
33+
@Target({TYPE})
34+
@Retention(RUNTIME)
35+
public @interface Jsr351IdentityStoreDefinition {
3036
String name();
3137
}

user-and-role-service/src/main/java/javax/security/auth/user/LdapUserSourceDefinition.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/LdapIdentityStoreDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
2323

24-
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
25-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
26-
public @interface LdapUserSourceDefinition {
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
29+
30+
@Target({TYPE})
31+
@Retention(RUNTIME)
32+
public @interface LdapIdentityStoreDefinition {
2733
String name();
2834

2935
String ldapUrl();

user-and-role-service/src/main/java/javax/security/auth/user/MemoryUserSourceDefinition.java renamed to identity-store-jndi-with-rolemapper/src/main/java/javax/security/auth/identitystore/MemoryIdentityStoreDefinition.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,19 @@
1919
// Community Process. In order to remain compliant with the specification
2020
// DO NOT add / change / or delete method signatures!
2121
//
22-
package javax.security.auth.user;
22+
package javax.security.auth.identitystore;
23+
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
2329

2430
/**
2531
* Code-embedded users, or read from file (JSON, XML, or Properties)
2632
*/
27-
@java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE})
28-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
29-
public @interface MemoryUserSourceDefinition {
33+
@Target({TYPE})
34+
@Retention(RUNTIME)
35+
public @interface MemoryIdentityStoreDefinition {
3036
String name();
3137
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
//
18+
// This source code implements specifications defined by the Java
19+
// Community Process. In order to remain compliant with the specification
20+
// DO NOT add / change / or delete method signatures!
21+
//
22+
package javax.security.auth.identitystore;
23+
24+
import static java.lang.annotation.ElementType.TYPE;
25+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
26+
27+
import java.lang.annotation.Retention;
28+
import java.lang.annotation.Target;
29+
30+
@Target({TYPE})
31+
@Retention(RUNTIME)
32+
public @interface ServerIdentityStoreDefinition {
33+
String name();
34+
}

0 commit comments

Comments
 (0)