Skip to content

Commit f1f76a3

Browse files
kennyptt
andauthored
DynoID Helpers for Testing and Local Development (#225)
* 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]>
1 parent 573c0c2 commit f1f76a3

18 files changed

+1403
-88
lines changed

.github/workflows/ci.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ on: [ push ]
55
jobs:
66
ci:
77
runs-on: [ ubuntu-latest ]
8+
env:
9+
GOMARKDOC_OPTS: -c
810
strategy:
911
matrix:
10-
target: [ test, lint ]
12+
target: [ test, lint, docs ]
1113
steps:
1214
- uses: actions/checkout@v4
1315
- uses: actions/setup-go@v4

.github/workflows/codeql-analysis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: "Code scanning - action"
22

33
on:
4-
push:
5-
pull_request:
64
schedule:
75
- cron: '0 12 * * 6'
86

.golangci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ issues:
3131
- scopelint # Otherwise you need tc := tc. This isn't actually a problem unless tests are being run in parallel.
3232
- lll # Don't do line length checks in test code.
3333
- dupl # Sometimes we duplicate a bunch in tests for the sake of clarity.
34+
- gosec # Don't run gosec, it's insecure because it's a test
3435
- path: nacl/secretbox
3536
linters:
3637
- gosec # Don't run gosec on nacl/secretbox* because we know it uses crypto/md5. TODO: Evaluate if this makes sense.
@@ -43,9 +44,6 @@ issues:
4344
- path: grpc/
4445
linters:
4546
- lll # GRPC code has notoriously long function signatures.
46-
- path: testing/mustcert/example_test.go
47-
linters:
48-
- gosec # Don't run gosec, it's insecure because it's a test
4947

5048
linters-settings:
5149
misspell:

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PROTOC_DOWNLOAD_URL = https://github.com/protocolbuffers/protobuf/releases/downl
2222
# Additive or overridable variables
2323
override GOTEST_OPT += -timeout 30s
2424
LINT_RUN_OPTS ?= --fix
25+
override GOMARKDOC_OPTS += --header="" --repository.url="https://github.com/heroku/x" --repository.path="/" --repository.default-branch="master"
2526

2627
.DEFAULT_GOAL := precommit
2728

@@ -78,3 +79,10 @@ proto: $(TOOLS_BIN)/protoc $(TOOLS_BIN)/protoc-gen-go | $(TOOLS_BIN) ## Regenera
7879
--go_out=paths=source_relative:. \
7980
--loggingtags_out=. \
8081
./cmd/protoc-gen-loggingtags/internal/test/*.proto
82+
83+
$(GOPATH)/bin/gomarkdoc:
84+
go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
85+
86+
.PHONY: docs
87+
docs: $(GOPATH)/bin/gomarkdoc ## Generate docs using gomarkdoc
88+
$< $(GOMARKDOC_OPTS) -o ./dynoid/README.md -e ./dynoid/...

0 commit comments

Comments
 (0)