Skip to content

Commit 8e2a26c

Browse files
committed
goreleaser
1 parent f4c4073 commit 8e2a26c

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed

.github/workflows/go.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
matrix:
77
go:
88
- 1.14
9+
- 1.15
910
name: Build
1011
runs-on: ubuntu-latest
1112

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- "!**/*"
7+
tags:
8+
- "v*"
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Set up Go
17+
uses: actions/setup-go@v1
18+
with:
19+
go-version: 1.15
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v1
22+
with:
23+
version: latest
24+
args: release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
before:
2+
hooks:
3+
- go mod download
4+
builds:
5+
- env:
6+
- CGO_ENABLED=0
7+
main: ./cmd/amzn-oidc-validate-server/main.go
8+
goarch:
9+
- darwin
10+
- amd64
11+
archives:
12+
checksum:
13+
name_template: "checksums.txt"
14+
snapshot:
15+
name_template: "{{ .Tag }}-next"
16+
changelog:
17+
sort: asc
18+
filters:
19+
exclude:
20+
- "^docs:"
21+
- "^test:"

README.md

+26-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
go-amzn-oidc is a validator for x-amzn-oidc-data as JWT.
88

9-
## Usage
9+
## Usage as a library
1010

1111
```go
1212
package main
@@ -36,6 +36,31 @@ func main() {
3636
}
3737
```
3838

39+
## With nginx auth_request
40+
41+
```console
42+
$ amzn-oidc-validate-server
43+
2020/10/24 01:50:06 [info] Listening 127.0.0.1:8080
44+
```
45+
46+
nginx.conf
47+
```conf
48+
location = /oidc_validate {
49+
proxy_pass http://127.0.0.1:8080;
50+
proxy_set_header X-Amzn-OIDC-Data $http_x_amzn_oidc_data;
51+
proxy_set_header Content-Length "";
52+
proxy_pass_request_body off;
53+
internal;
54+
}
55+
56+
location / {
57+
auth_request /oidc_validate;
58+
auth_request_set $email $upstream_http_x_auth_request_email;
59+
proxy_set_header X-Email $email;
60+
# ...
61+
}
62+
```
63+
3964
## LISENSE
4065

4166
MIT

0 commit comments

Comments
 (0)