~bigbes/core-go

ref: 31e77bac08eedc3d9bf64274b341466f66acf548 core-go/auth d---------
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
76279c9b — Simon Ser 4 years ago
Fix json struct tag

Found via `go vet`:

    auth/middleware.go:259:2: struct field tag `json:"oauth_client_id",omit-empty` not compatible with reflect.StructTag.Get: key:"value" pairs not separated by spaces
48250772 — Simon Ser 4 years ago
Remove %e formatting verbs

%e is not valid for formatting error values:

> %e	scientific notation, e.g. -1.234456e+78

Instead, use %w when using fmt.Errorf (for error wrapping) and
%v when using log.Printf (%w is not valid in that context).
3c6ab9bd — Drew DeVault 4 years ago
auth: improve error response format

This maps more closely onto what normal GQL errors look like.
ae61e243 — Drew DeVault 4 years ago
auth: force webhooks to read-only
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.
07f694d2 — Drew DeVault 4 years ago
webhooks: expand auth configuration

The purpose of this change is to enable internal webhooks to be
configured in GQL webhook tables. A webhook subscription now includes
the auth method field which is appropriate, which is limited to either
OAUTH2 or INTERNAL. In the former case, the previous set of fields will
be valid, and in the latter case, the NodeID field will be valid. This
will allow us to register webhook subscriptions for internal use.
4f926ddc — Drew DeVault 4 years ago
auth: fix /query/api-meta.json route

This route does not need authentication.
8bd6005b — Drew DeVault 5 years ago
webhooks: initial prototype for GQL-native webhooks
1d24fef3 — Drew DeVault 5 years ago
auth: s/OAuth2Token/BearerToken/g

This also makes some tweaks to the organization of the crypto module to
make it easier for us to add more keys in the future, which will be
necessary for the internal token redesign.
39cd24bd — Drew DeVault 5 years ago
auth: allow /query/metrics w/o authentication
b5e0030f — Drew DeVault 5 years ago
auth: fix user type on database insert
8d15b7e1 — Drew DeVault 5 years ago
auth: authenticate all requests under /query
f9731e15 — Drew DeVault 5 years ago
Various bug fixes per pages.sr.ht
900693b8 — Drew DeVault 5 years ago
crypto: harden API surface

Make it explicit that expiration is not being tested with Decrypt, and
test that the expiration is meaningful with DecryptWithExpiration.
31fc9fce — Drew DeVault 5 years ago
Fetch user PGP key for meta.sr.ht
e1acd5a8 — Drew DeVault 5 years ago
Correct TODO for context which is invariant
Next