~bigbes/core-go

30cea5cc — Simon Ser 3 years ago
server: fix error message on missing grant in Access

The error returned when a token is missing a required grant would
be "Access denied for invalid auth method" which is confusing.
Fix this with a more accurate error message.
43a2be15 — Simon Ser 3 years ago
database/middleware: don't use sql.Conn in WithTx

We can just use sql.DB instead of sql.Conn here. Simplifies the
code and reduces the risk of getting "bad connection" errors.
6f6bb872 — Drew DeVault 3 years ago
auth: add /query/external/* to anonymous whitelist
083cb160 — Adnan Maolood 3 years ago
redis: Update style

To match the s3 middleware.
156c5e26 — Adnan Maolood 3 years ago
s3: Import middleware from pages.sr.ht

Closes: https://todo.sr.ht/~sircmpwn/pages.sr.ht/19
89b1b489 — Simon Ser 3 years ago
auth/middleware: make auth scheme case-insensitive

According to RFC 7235 section 2.1, the auth scheme is
case-insensitive.
209e1a86 — Simon Ser 3 years ago
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.
1f6fac1d — Simon Ser 3 years ago
go mod tidy

Fixes the following error when running `go test`:

    ../../go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/internal/metric.go:19:2: missing go.sum entry for module providing package github.com/prometheus/client_model/go (imported by github.com/prometheus/client_golang/prometheus); to add:
    	go get github.com/prometheus/client_golang/prometheus@v1.14.0
ca47b9fe — Simon Ser 3 years ago
server/directives: handle auth.AUTH_ANON_INTERNAL in Access
78b6f723 — Conrad Hoffmann 3 years ago
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.
144fc447 — Drew DeVault 3 years ago
server: register SQL collector

Missed this step
fa27910a — Drew DeVault 3 years ago
Add prometheus SQL connection stats

Also updates the prometheus client_go library
57524862 — Dennis Schön 3 years ago
auth: fix invalid json tag in InternalAuth
2fd72e9f — Dennis Schön 3 years ago
email: handle error from Enqueue() in EnqueueStd()
b1540a22 — Conrad Hoffmann 3 years ago
Update pq (Postgres driver) to latest version
3e69641e — Adnan Maolood 4 years ago
auth: Use canonical user IDs

When adding users to the database, use the canonical user ID from
meta.sr.ht.
bb33e3e7 — Simon Ser 3 years ago
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.
8110e635 — Conrad Hoffmann 3 years ago
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)...)
12000f49 — Drew DeVault 3 years ago
Revert "auth: Use canonical user IDs"

This reverts commit 6c1036e2705d93e1cb71476ac78499ae27f0d326.
236879ae — Conrad Hoffmann 3 years ago
Run `go fmt`
Next