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 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 principal
      invocationContext - current invocation context
      audit - safe audit collector
  • Method Details

    • approve

      @Deadline(millis=500L) public AnnotationApprovalResult approve(String invoiceId, String amount)
      Approves an invoice when the caller has the required role.
      Parameters:
      invoiceId - public invoice id
      amount - sensitive amount
      Returns:
      safe result