Skip to content

calm-hub: NamespaceAccessFilter's request-scoped SecurityIdentity is unsafe off a request thread #3097

Description

@jpgough-ms

NamespaceAccessFilter is @ApplicationScoped but constructor-injects a request-scoped SecurityIdentity (NamespaceAccessFilter.java:26,30,37). Works today because every call happens on a request thread, where CDI resolves the identity through its normal-scope proxy.

Risk: called from a non-request context — a @Scheduled sync tick, or GitHubStartupInitializer's startup thread — and the proxy has no active request to delegate to. Throws ContextNotActiveException.

Fix: confirm (and document) that this filter is never reachable off a request thread, or restructure so it doesn't depend on request-scoped state outside one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions