~bigbes/core-go

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.
590c9c42 — Drew DeVault 4 years ago
server: add @private directive glue code
4f926ddc — Drew DeVault 4 years ago
auth: fix /query/api-meta.json route

This route does not need authentication.
5f76a1f4 — Drew DeVault 4 years ago
Enforce complexity limit on webhook payload
1371ba4b — Drew DeVault 4 years ago
Configure server to manage mail queue

This also sets up the recovery function for webhooks, so we get emailed
when we panic during a webhook query.
cb5aee1b — Drew DeVault 4 years ago
valid: accept format strings
0abb9c6b — Drew DeVault 4 years ago
valid: Fix Sprintf call
e4d7b5ff — Drew DeVault 4 years ago
valid: new module for input validation
86e1e934 — Drew DeVault 5 years ago
webhooks: panic on nested webhook auth case

This is not strictly speaking necessary since we have a panic which
immediately follows the switch, but it is cleaner.
Next