Class AnnotationSecureService
java.lang.Object
org.j7m.middleware.examples.annotation.AnnotationSecureService
@J7mService(name="//apps/example/annotation/secure/ApprovalService",
exported=true,
transport="default")
public final class AnnotationSecureService
extends Object
Secure annotation-first service used by examples.
The public security annotations are descriptor metadata reflected by the application platform. Runtime authorization remains a policy decision; this example evaluates the role requirement locally so the demo can show an authorized and denied path without depending on an external identity provider. Sensitive values are redacted before audit output.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationSecureService(org.j7m.middleware.security.api.Principal principal, org.j7m.middleware.application.api.InvocationContext invocationContext, AnnotationExampleAudit audit) Creates a secure service scoped to the current invocation. -
Method Summary
Modifier and TypeMethodDescriptionApproves an invoice when the caller has the required role.
-
Constructor Details
-
AnnotationSecureService
@Inject public AnnotationSecureService(@CurrentPrincipal org.j7m.middleware.security.api.Principal principal, @CurrentInvocation org.j7m.middleware.application.api.InvocationContext invocationContext, AnnotationExampleAudit audit) Creates a secure service scoped to the current invocation.- Parameters:
principal- current caller principalinvocationContext- current invocation contextaudit- safe audit collector
-
-
Method Details
-
approve
Approves an invoice when the caller has the required role.- Parameters:
invoiceId- public invoice idamount- sensitive amount- Returns:
- safe result
-