File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
services-api/src/main/java/io/scalecube/services/auth Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 99public interface Principal {
1010
1111 /**
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.
1414 */
1515 Principal NULL_PRINCIPAL =
1616 new Principal () {
Original file line number Diff line number Diff line change 33import io .scalecube .services .RequestContext ;
44import reactor .core .publisher .Mono ;
55
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+ */
615@ FunctionalInterface
716public interface PrincipalMapper {
817
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+ */
924 Mono <Principal > map (RequestContext requestContext );
1025}
You can’t perform that action at this time.
0 commit comments