Skip to content

BUGFIX: Fix Policy to properly trigger authentication for GraphQL queries/mutations#307

Merged
Sebobo merged 2 commits into
mainfrom
bugfix/305-fix-policy
Jul 22, 2026
Merged

BUGFIX: Fix Policy to properly trigger authentication for GraphQL queries/mutations#307
Sebobo merged 2 commits into
mainfrom
bugfix/305-fix-policy

Conversation

@bwaidelich

Copy link
Copy Markdown
Contributor

Policy.yaml still referred to some no-longer used t3n\GraphQL namespace. By fixing the method privilege matcher to point to public methods of the MediaApi class, the PolicyEnforcementAspect is properly invoked, triggering authentication.

Fixes: #305

@Sebobo

Sebobo commented Jul 22, 2026

Copy link
Copy Markdown
Member

Amazing, thx 😆

@Sebobo

Sebobo commented Jul 22, 2026

Copy link
Copy Markdown
Member

Unit tests are not happy

The Queries privilege target matched all public methods of MediaApi
including __construct, so mere instantiation of the class required
authentication - breaking functional tests and any unauthenticated
context that injects MediaApi.

Related: #305

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bwaidelich

Copy link
Copy Markdown
Contributor Author

Unit tests are not happy
now they are :)

@MiauzGenau

Copy link
Copy Markdown

I tested it and it seems to resolve the issue for us 👍

@Sebobo

Sebobo commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thx! So this resolves #305 now?

@Sebobo
Sebobo self-requested a review July 22, 2026 12:44
@Sebobo Sebobo added the Bug Something isn't working label Jul 22, 2026
@Sebobo
Sebobo merged commit 5584845 into main Jul 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Sessionless authentication providers are not authenticated in GraphQLMiddleware

3 participants