~bigbes/core-go

ref: 0d6031bec59cdb9d3d9b735ce99ed5249fa5651e core-go/auth d---------
0d6031be — Conrad Hoffmann 1 year, 11 months ago
server: use routing groups

Instead of hardcoding some exceptions in the auth middleware, use a
different routing group for routes that do not require auth. Makes the
auth middleware more generic and also removes a lot of unneccessary
middleware processing from routes that don't need it.

For now, the added group is not accessible from outside the module, but
if the need arises, this might be an option.
bd40a71a — Drew DeVault 2 years ago
auth: add auth.IPAddress

With support for X-Forwarded-For
88dff0ea — Simon Ser 2 years ago
auth/middleware: set WWW-Authenticate header field

See RFC 6750 section 3.
864816cf — Simon Ser 2 years ago
client: rename Execute to Do

583d0b1bcb08 ("client/graphql: handle GraphQL errors") changed
Execute behavior by wrapping the result into a struct with "data"
and "errors" fields. This is a breaking change, but it's hard to
spot when upgrading core-go because it won't cause a compilation
error.

Rename Execute to Do to break the build and force callers to update
accordingly.
23808bb0 — Simon Ser 2 years ago
auth: add RequireMiddleware

Same as Middleware, but requires auth for all requests. Will be
useful to drop hacks from pages.sr.ht.
53966da2 — Simon Ser 2 years ago
Drop gqlparser v1 dependency

Only use v2 throughout the repository.
d83af997 — Simon Ser 3 years ago
auth: make DecodeGrants return an error

We'll use this function to validate grants passed in via
builds.sr.ht manifests.
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).
6f6bb872 — Drew DeVault 3 years ago
auth: add /query/external/* to anonymous whitelist
89b1b489 — Simon Ser 3 years ago
auth/middleware: make auth scheme case-insensitive

According to RFC 7235 section 2.1, the auth scheme is
case-insensitive.
57524862 — Dennis Schön 3 years ago
auth: fix invalid json tag in InternalAuth
3e69641e — Adnan Maolood 4 years ago
auth: Use canonical user IDs

When adding users to the database, use the canonical user ID from
meta.sr.ht.
12000f49 — Drew DeVault 3 years ago
Revert "auth: Use canonical user IDs"

This reverts commit 6c1036e2705d93e1cb71476ac78499ae27f0d326.
6c1036e2 — Adnan Maolood 4 years ago
auth: Use canonical user IDs

When adding users to the database, use the canonical user ID from
meta.sr.ht.
b2c8e81e — Conrad Hoffmann 4 years ago
Fix (some) user PGP key lookups from meta.sr.ht

The authForUsername() function uses a closure that is almost identical
to the LookupUser() function, but is missing the handling for the PGP
key if called from meta.sr.ht. This causes at least the email
notifications for new OAuth2 tokens to be sent unencrypted. This commit
fixes that (and reduces code duplication) by calling LookupUser()
instead.

This requires the context for the tests to have a value for the calling
service, so add that to the mock.
e28d47cf — Adnan Maolood 4 years ago
go fmt
f9c34fc3 — Josh Junon 4 years ago
auth: fix nil reference in auth method check
378fedbc — Drew DeVault 4 years ago
Add @anoninternal support code

This is a slightly better approach to the previous commit.
fbc8f491 — Drew DeVault 4 years ago
auth: implement internal anonymous authentication

This is used for meta.sr.ht's GraphQL user registration resolver, which
needs to run prior to the user's information being added to the database.
f44afb10 — Simon Ser 4 years ago
go fmt
Next