File tree 2 files changed +17
-2
lines changed
services-api/src/main/java/io/scalecube/services/auth
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 9
9
public interface Principal {
10
10
11
11
/**
12
- * A constant representing a "null" principal, which signifies an unauthenticated entity. This
13
- * principal does not have any roles or permissions.
12
+ * Null principal, which signifies an unauthenticated entity. This principal does not have any
13
+ * roles or permissions.
14
14
*/
15
15
Principal NULL_PRINCIPAL =
16
16
new Principal () {
Original file line number Diff line number Diff line change 3
3
import io .scalecube .services .RequestContext ;
4
4
import reactor .core .publisher .Mono ;
5
5
6
+ /**
7
+ * Functional interface for transforming existing {@link Principal} from {@link RequestContext} to
8
+ * the new {@link Principal}. This interface allows to modify or replace a current principal from
9
+ * {@link RequestContext}, allowing for dynamic adjustments to authentication and authorization
10
+ * logic based on the request context.
11
+ *
12
+ * @see Principal
13
+ * @see RequestContext
14
+ */
6
15
@ FunctionalInterface
7
16
public interface PrincipalMapper {
8
17
18
+ /**
19
+ * Maps current principal in the provided {@link RequestContext} to the new {@link Principal}.
20
+ *
21
+ * @param requestContext {@link RequestContext} containing the current principal
22
+ * @return {@link Mono} emitting the new {@link Principal} after the transformation
23
+ */
9
24
Mono <Principal > map (RequestContext requestContext );
10
25
}
You can’t perform that action at this time.
0 commit comments