auth: add /query/external/* to anonymous whitelist
redis: Update style
To match the s3 middleware.
auth/middleware: make auth scheme case-insensitive
According to RFC 7235 section 2.1, the auth scheme is
case-insensitive.
database/middleware: do not recover/panic in defer
defer always runs after a panic. There is no need to recover and
re-panic, we can just unconditionally tx.Rollback() (it will
silently error out if the transaction has already been committed or
rolled back).
This fixes the stack trace of the panic being incorrect. It points
to this function instead of the real culprit.
server/directives: handle auth.AUTH_ANON_INTERNAL in Access
email: remove content headers of passed-in message
The email has already been parsed according to the headers, but they are
still present. However, signing or encrypting the email will change the
content format, so remove any such headers before continuing.
server: register SQL collector
Missed this step
Add prometheus SQL connection stats
Also updates the prometheus client_go library
auth: fix invalid json tag in InternalAuth
email: handle error from Enqueue() in EnqueueStd()
Update pq (Postgres driver) to latest version
auth: Use canonical user IDs
When adding users to the database, use the canonical user ID from
meta.sr.ht.
email/worker: add more context to errors
For instance, failure to open the private PGP key would just fail
with an unhelpful "panic: open : no such file or directory" error.
database: add helpers to fetch all columns
The current solution of fetching columns based on the GraphQL context
has some limits. While probably not the solution for all use-cases, it
sometimes can be desirable to simply fetch all columns from the database
when retrieving objects.
This commit adds two simple functions doing just that. They can be used
when building SQL queries, like
query := database.SelectAll(new(model.Email))
and
rows.Scan(database.ScanAll(&email)...)
auth: Use canonical user IDs
When adding users to the database, use the canonical user ID from
meta.sr.ht.
webhooks.FilterWebhooks: Filter by user_id