~bigbes/core-go

ref: 00f113a4daeafc6b0d47e8cf50205b53812c78af core-go/server/directives.go -rw-r--r-- 1.4 KiB
c5355d17 — Conrad Hoffmann 8 months ago
server: let AUTH_INTERNAL access @anoninternal

Both methods enforce the internal aspect, but @anoninternal really just
means the resolver does not require an "authenticated user" context,
which means it's still perfectly safe if there is one.

With this in place, any resolver that may have to be called from an
anonymous context can be switched from @internal to @anoninternal
without breaking existing users. Of course it can only be switched if it
really does not require a user context.
20be483e — Conrad Hoffmann 9 months ago
Don't uppercase error messages
39c3fd1e — Conrad Hoffmann 9 months ago
Run modernize

See https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize

It's mostly interface{} -> any, but also two quite useful applications
of slices.Contains.
0ad8eb8e — Drew DeVault 1 year, 7 months ago
server: add @admin directive implementation

This will be used at least by meta.sr.ht in the near future.
453dcaef — Simon Ser 2 years ago
server/directives: disambiguate AnonInternal error message

AUTH_INTERNAL won't work with AnonInternal.
65b1657b — Simon Ser 3 years ago
auth: add AuthContext.Access

Same logic as server.Access, but lower-level. Useful to check for
a permission not covered by the GraphQL schema @access directives
(such as builds.sr.ht secrets).
30cea5cc — Simon Ser 3 years ago
server: fix error message on missing grant in Access

The error returned when a token is missing a required grant would
be "Access denied for invalid auth method" which is confusing.
Fix this with a more accurate error message.
ca47b9fe — Simon Ser 3 years ago
server/directives: handle auth.AUTH_ANON_INTERNAL in Access
d5f650da — Simon Ser 4 years ago
Allow AUTH_COOKIE to access @private fields
378fedbc — Drew DeVault 4 years ago
Add @anoninternal support code

This is a slightly better approach to the previous commit.
2d9a547c — Drew DeVault 4 years ago
auth: harden grants structure

This replaces the Access map with a data type whose default value does
not grant any permissions, so that it's more difficult to create an
insecure auth context by mistake.
590c9c42 — Drew DeVault 4 years ago
server: add @private directive glue code
8bd6005b — Drew DeVault 5 years ago
webhooks: initial prototype for GQL-native webhooks
52d6dc99 — Drew DeVault 5 years ago
Fix bug with internal authentication
7be038e7 — Drew DeVault 5 years ago
Make authorization errors more specific
1d2a30cb — Drew DeVault 5 years ago
Import GQL server interfaces from gql.sr.ht