~bigbes/core-go

d5f650da — Simon Ser 4 years ago
Allow AUTH_COOKIE to access @private fields
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.
3b553750 — Drew DeVault 4 years ago
webhooks: fix failing test
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.
9f634ce0 — Drew DeVault 4 years ago
server/email: handle errors out of GQL context
46875256 — Drew DeVault 4 years ago
webhooks/legacy: fetch subscriptions upfront

This fixes a race condition when delivering webhooks for resource
deletion events, in which the subscriptions would be removed from the
delete cascade before the task to fetch them executes. This requires the
downstream code to call Queue before committing the delete transaction,
and updates the API to include a context argument for the connection
pool.
d74ae98e — Drew DeVault 4 years ago
server/email: include variables
dea4ef29 — Drew DeVault 4 years ago
server: move auth middlware ahead of RealIP

So that @internal auth can correctly test against internal-ipnet.
129dc1ba — Drew DeVault 4 years ago
valid: fix nil values in OptionalString
073f2633 — Drew DeVault 4 years ago
valid: add generic optional interface
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.
cdb177bb — Drew DeVault 4 years ago
(*WebhookQueue).deliverPayload: address error nit

This return does not need to be here.
99671f85 — Drew DeVault 4 years ago
webhooks: add comment clarifying field usage
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.
Next