Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More accurate OAS based on authenticated user #20462

Merged
merged 3 commits into from
Nov 17, 2023
Merged

More accurate OAS based on authenticated user #20462

merged 3 commits into from
Nov 17, 2023

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Nov 17, 2023

Scope

What's changed:

  • Return only paths / schemas that are actually available for current user (differentiating between public / normal user / admin)
  • Ensure all included schemas are available
  • Bit of clean-up

Potential Risks / Drawbacks

  • Currently, required schemas are manually defined via x-schemas in openapi.yaml, meaning that it if the specs are updated it must be ensured that those are still correct. In the future, this could be made more dynamic by pulling in the schemas based on used $refs.

Review Notes / Questions

oas-user.json
oas-public.json
oas-user.json

Copy link

changeset-bot bot commented Nov 17, 2023

🦋 Changeset detected

Latest commit: 98dd671

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@directus/api Patch
@directus/specs Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@paescuj paescuj merged commit c6f47f9 into main Nov 17, 2023
4 checks passed
@paescuj paescuj deleted the accurate-oas branch November 17, 2023 16:24
@github-actions github-actions bot added this to the Next Release milestone Nov 17, 2023
@paescuj paescuj mentioned this pull request Nov 17, 2023
@Luca-Dekker
Copy link

Currently this last version breaks all of the graphql introspection using a bearer token. @paescuj

@br41nslug
Copy link
Member

@Luca-Dekker Authenticated introspection is working on my side but perhaps you're referring to SDL generation? #20490

If you mean something else do create a new issue for that instead of commenting on a potentially unrelated pull request.

@Luca-Dekker
Copy link

When fetching graphql schema's from using admin authentication/bearer token it doesn't return the full schema specifications, downgrading from 10.8.1 to 10.8.0 worked for me, I'm commenting here because this was the pull request that broke it. Just a heads up.

  • ****/server/specs/graphql
  • ****/server/specs/graphql/system

@br41nslug
Copy link
Member

Feel free to add that context on the issue I linked which seems to match your issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants