Skip to content

chore(backend): init graphql authorization#1245

Merged
edgehog-app[bot] merged 1 commit intoedgehog-device-manager:mainfrom
lusergit:push-tmqpulmrskxn
Mar 30, 2026
Merged

chore(backend): init graphql authorization#1245
edgehog-app[bot] merged 1 commit intoedgehog-device-manager:mainfrom
lusergit:push-tmqpulmrskxn

Conversation

@lusergit
Copy link
Copy Markdown
Collaborator

@lusergit lusergit commented Feb 18, 2026

initialize edgehog authorization.

Adds an authorization layer, providing an actor to queries trough the token claims. Such actor can then be used to authorize the query/mutation and allow subscriptions.

For the moment the same flow we're using is preserved: we just check that the claim e_tga is present

Checklist

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added or updated documentation (if appropriate)

@lusergit lusergit force-pushed the push-tmqpulmrskxn branch 2 times, most recently from 8fc12a2 to d296318 Compare February 20, 2026 15:43
@lusergit lusergit force-pushed the push-tmqpulmrskxn branch 10 times, most recently from 601a5f1 to 16d098f Compare March 19, 2026 10:23
@lusergit lusergit force-pushed the push-tmqpulmrskxn branch 13 times, most recently from fc7a73a to 57ff953 Compare March 27, 2026 08:28
@lusergit lusergit changed the title feat!(backend): graphql authorization chore(backend): init graphql authorization Mar 27, 2026
@lusergit lusergit marked this pull request as ready for review March 27, 2026 08:34
@lusergit lusergit requested review from ArnelaL and Dam-99 March 27, 2026 16:15
@lusergit lusergit force-pushed the push-tmqpulmrskxn branch from 57ff953 to 076039b Compare March 30, 2026 06:50
Comment thread backend/lib/edgehog_web/router.ex Outdated
pipeline :triggers do
plug :accepts, ["json"]
plug EdgehogWeb.PopulateTenant
plug EdgehogWeb.PopulateActor
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this on triggers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the long run -> yes. That way only astarte should be able to trigger triggers. For the time being we can keep the old behavior and only populate the actor for graphql APIs

Comment thread backend/lib/edgehog/groups/groups.ex Outdated
Adds an authorization layer, providing an actor to queries trough the token
claims. Such actor is then used to authorize the query/mutation and allow
subscriptions.

The claims structures is unchanged, the actor only contains a map with the
matched claims and is not persisted in the database, but rather passed down the
context of triggered actions.

Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
@lusergit lusergit force-pushed the push-tmqpulmrskxn branch from 076039b to b174bca Compare March 30, 2026 07:56
@lusergit
Copy link
Copy Markdown
Collaborator Author

/fast-forward

@edgehog-app edgehog-app bot merged commit b174bca into edgehog-device-manager:main Mar 30, 2026
24 checks passed
@lusergit lusergit deleted the push-tmqpulmrskxn branch March 30, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants