~bigbes/core-go

ref: 0936891734e7f92b7ad724caea27715f2e3e7b5c core-go/auth/bearer.go -rw-r--r-- 3.7 KiB
62578ea9 — Drew DeVault 1 year, 12 days ago
auth/bearer: log username associated with expired token
465a6f71 — Drew DeVault 1 year, 6 months ago
all: pass errors to panic, not strings

GraphQL's recovery middleware can't handle strings so it just logs a
very not useful <nil>
46a4ad6a — Drew DeVault 1 year, 10 months ago
auth: add Grants.IsSubset

This is a little bit hacky. Previously DecodeGrants would only store the
list of grants associated with the current service. This minimizes API
breakage by storing all grants as $service/$grant in the map key and
stores the local service name in the grant object, and updates
Grants.Has() to accept "$grant" and infer that it refers to a local
service or accept the fully qualified "$service/$grant" to test against
grants for any service -- which IsSubset makes use of to test that one
Grant object is a subset of another with respect to all services it has
grants for.
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.
f44afb10 — Simon Ser 4 years ago
go fmt
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).
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.
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.
f9731e15 — Drew DeVault 5 years ago
Various bug fixes per pages.sr.ht
bfc744fc — Drew DeVault 5 years ago
Add basic auth tests
1d2a30cb — Drew DeVault 5 years ago
Import GQL server interfaces from gql.sr.ht