Skip to content

Commit

Permalink
DynoID Helpers for Testing and Local Development (#225)
Browse files Browse the repository at this point in the history
* Add LocalIssuer middleware to make testing and local development easier.
* Create functions useful for local development and testing.
* Add IssuerOpt for providing a private key.
* Handle nil when logging.
* Don't run CodeQL on push/pr since it's not currently working.
* DynoID docs
* Changed `AuthorizeSpaces` to use the same issuer as the current app.
* Added `AuthorizeSpacesWIthIssuer` to allow for the previous behavior specifying the issuer host.
* Move context functions from middleware package to dynoid package.
* Add examples
* Add CI check for docs.

---------

Co-authored-by: Troels Thomsen <[email protected]>
  • Loading branch information
kennyp and tt authored Oct 24, 2024
1 parent 573c0c2 commit f1f76a3
Show file tree
Hide file tree
Showing 18 changed files with 1,403 additions and 88 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on: [ push ]
jobs:
ci:
runs-on: [ ubuntu-latest ]
env:
GOMARKDOC_OPTS: -c
strategy:
matrix:
target: [ test, lint ]
target: [ test, lint, docs ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 12 * * 6'

Expand Down
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ issues:
- scopelint # Otherwise you need tc := tc. This isn't actually a problem unless tests are being run in parallel.
- lll # Don't do line length checks in test code.
- dupl # Sometimes we duplicate a bunch in tests for the sake of clarity.
- gosec # Don't run gosec, it's insecure because it's a test
- path: nacl/secretbox
linters:
- gosec # Don't run gosec on nacl/secretbox* because we know it uses crypto/md5. TODO: Evaluate if this makes sense.
Expand All @@ -43,9 +44,6 @@ issues:
- path: grpc/
linters:
- lll # GRPC code has notoriously long function signatures.
- path: testing/mustcert/example_test.go
linters:
- gosec # Don't run gosec, it's insecure because it's a test

linters-settings:
misspell:
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PROTOC_DOWNLOAD_URL = https://github.com/protocolbuffers/protobuf/releases/downl
# Additive or overridable variables
override GOTEST_OPT += -timeout 30s
LINT_RUN_OPTS ?= --fix
override GOMARKDOC_OPTS += --header="" --repository.url="https://github.com/heroku/x" --repository.path="/" --repository.default-branch="master"

.DEFAULT_GOAL := precommit

Expand Down Expand Up @@ -78,3 +79,10 @@ proto: $(TOOLS_BIN)/protoc $(TOOLS_BIN)/protoc-gen-go | $(TOOLS_BIN) ## Regenera
--go_out=paths=source_relative:. \
--loggingtags_out=. \
./cmd/protoc-gen-loggingtags/internal/test/*.proto

$(GOPATH)/bin/gomarkdoc:
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest

.PHONY: docs
docs: $(GOPATH)/bin/gomarkdoc ## Generate docs using gomarkdoc
$< $(GOMARKDOC_OPTS) -o ./dynoid/README.md -e ./dynoid/...
Loading

0 comments on commit f1f76a3

Please sign in to comment.