Skip to content

Commit 3d2df30

Browse files
authored
0.10.0 (#427)
2 parents ed0d774 + 7d132da commit 3d2df30

File tree

298 files changed

+42611
-2354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+42611
-2354
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
tags
77
client.config
88
config/config.yaml
9+
config/notifier-config.yaml
910
config/docker-config.yaml
1011
IP2LOCATION-LITE-DB1.IPV6.BIN
1112
/cmd/test
1213
generateDDL.sh
13-
dist/
14+
/dist/
1415
/mytoken-migratedb
1516
/docker/docker-compose.yaml
1617
/docker/db.env

.gitlab-ci-scripts/goreleaser.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
mkdir ../shared
24
first=$(grep '^## ' -nm1 CHANGELOG.md | cut -d':' -f1); \
35
second=$(grep '^## ' -nm2 CHANGELOG.md | tail -n1 | cut -d':' -f1); \
@@ -6,5 +8,13 @@ GORELEASER_CONFIG=".goreleaser.yml"
68
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then
79
GORELEASER_CONFIG=".goreleaser-release.yml"
810
fi
9-
goreleaser release -f $GORELEASER_CONFIG --release-notes ../shared/release.md
11+
GORELEASER_OPTIONS=""
12+
[[ "${CI_COMMIT_BRANCH}" != "${CI_DEFAULT_BRANCH}" ]] && {
13+
[[ "${CI_COMMIT_BRANCH}" != "${PREREL_BRANCH_NAME}" ]] && {
14+
# we're on devel
15+
GORELEASER_OPTIONS="--skip docker"
16+
}
17+
}
18+
19+
goreleaser release -f $GORELEASER_CONFIG --release-notes ../shared/release.md --verbose ${GORELEASER_OPTIONS}
1020
ls -l results

.gitlab-ci-scripts/set-prerel-version.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
DEVSTRING="pr"
44
VERSION_FILE=internal/model/version/VERSION
@@ -38,9 +38,17 @@ for R in $REMOTES; do
3838
MASTER_BRANCH="refs/remotes/${R}/${MASTER}"
3939
#echo "Master-branch: ${MASTER_BRANCH}"
4040
[ "x${R}" = "xorigin" ] && break
41+
[ "x${R}" = "xcodebase" ] && break
4142
done
4243

43-
PREREL=$(git rev-list --count HEAD ^"$MASTER_BRANCH")
44+
[[ "${DEVSTRING}" == "dev" ]] && {
45+
[[ -z ${CI_JOB_ID} ]] || {
46+
PREREL=${CI_JOB_ID}
47+
}
48+
}
49+
[[ -z ${PREREL} ]] && {
50+
PREREL=$(git rev-list --count HEAD ^"$MASTER_BRANCH")
51+
}
4452

4553
# use version file:
4654
VERSION=$(cat "$VERSION_FILE")

.gitlab-ci-scripts/upload.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12

23
REPO_TARGET="/prerel"
34
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then

.gitlab-ci.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
include:
22
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/-/raw/master/ci-include/github-status-sync.yml'
3+
- "https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/raw/master/ci-include/pipeline-jobs-publish-to-repo.yml"
4+
35

46
variables:
7+
USE_GORELEASER: "true"
58
UPSTREAM_PROJECT: oidc-mytoken/server
69

7-
image: golang:1.19
10+
image: golang:1.22
811
stages:
912
- build
1013
- test
1114
- lint
12-
- release
15+
- package
16+
- publish
1317
- deploy
1418

1519
default:
@@ -44,7 +48,7 @@ staticcheck:
4448
vet:
4549
stage: lint
4650
script:
47-
- go vet ./...
51+
- go vet -structtag=false ./...
4852

4953
build_server:
5054
stage: build
@@ -61,19 +65,17 @@ build_migratedb:
6165
script:
6266
- go build github.com/oidc-mytoken/server/cmd/mytoken-server/mytoken-migratedb
6367

64-
prerelease:
65-
stage: release
68+
package:
69+
stage: package
6670
image:
6771
name: goreleaser/goreleaser
6872
entrypoint: [ "" ]
6973
services:
7074
- docker:dind
71-
only:
72-
refs:
73-
- tags
74-
- prerel
75-
tags:
76-
- linux
75+
# only:
76+
# refs:
77+
# - tags
78+
# - prerel
7779
variables:
7880
GIT_STRATEGY: clone
7981
GIT_DEPTH: 0
@@ -83,13 +85,27 @@ prerelease:
8385
before_script:
8486
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
8587
script:
86-
- if [ -z "$CI_COMMIT_TAG" ]; then .gitlab-ci-scripts/set-prerel-version.sh; fi;
87-
- .gitlab-ci-scripts/goreleaser.sh
88-
- .gitlab-ci-scripts/upload.sh
88+
- |
89+
[[ "$CI_COMMIT_BRANCH" == "${PREREL_BRANCH_NAME}" ]] && {
90+
echo "Running set-prerel-version"
91+
.gitlab-ci-scripts/set-prerel-version.sh
92+
}
93+
[[ "$CI_COMMIT_BRANCH" != "${PREREL_BRANCH_NAME}" ]] && {
94+
[[ "$CI_COMMIT_BRANCH" != "${CI_DEFAULT_BRANCH}" ]] && {
95+
# we're on a devel branch
96+
echo "Running set-devel-version"
97+
.gitlab-ci-scripts/set-prerel-version.sh --devstring dev
98+
}
99+
}
100+
.gitlab-ci-scripts/goreleaser.sh
101+
102+
artifacts:
103+
paths:
104+
- "results/*"
89105
after_script:
90106
- curl -d "repo=github.com/oidc-mytoken/server" https://goreportcard.com/checks
91107

92-
deploy-dev:
108+
deploy-prerel:
93109
stage: deploy
94110
only:
95111
refs:
@@ -99,4 +115,4 @@ deploy-dev:
99115
- cp $KNOWN_HOSTS /root/.ssh/known_hosts
100116
- cp $DEPLOYMENT_SSH_KEY /root/.ssh/id_ed25519 && chmod 0600 /root/.ssh/id_ed25519
101117
script:
102-
- ssh mytoken-dev.vm.fedcloud.eu
118+
- ssh -4 mytoken.data.kit.edu

.goreleaser-release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ builds:
3434
flags:
3535
- -trimpath
3636
mod_timestamp: '{{ .CommitTimestamp }}'
37+
- id: notifier-server
38+
main: ./cmd/mytoken-server/mytoken-notifier-server
39+
binary: mytoken-notifier-server
40+
env:
41+
- CGO_ENABLED=0
42+
goos:
43+
- linux
44+
flags:
45+
- -trimpath
46+
mod_timestamp: '{{ .CommitTimestamp }}'
3747
archives:
3848
- name_template: >-
3949
{{ .ProjectName }}_{{ .Version }}_
@@ -121,6 +131,28 @@ nfpms:
121131
file_name_template: >-
122132
{{ .PackageName }}-{{ .Version }}.
123133
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
134+
- id: notifier-pkg
135+
package_name: mytoken-notifier-server
136+
file_name_template: >-
137+
{{ .PackageName }}_{{ .Version }}_
138+
{{- if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}
139+
builds:
140+
- notifier-server
141+
homepage: https://mytoken-docs.data.kit.edu/server
142+
maintainer: Gabriel Zachmann <[email protected]>
143+
description: A standalone notifier server for mytoken notifications
144+
license: MIT
145+
formats:
146+
- deb
147+
- rpm
148+
release: "1"
149+
section: misc
150+
bindir: /usr/bin
151+
overrides:
152+
rpm:
153+
file_name_template: >-
154+
{{ .PackageName }}-{{ .Version }}.
155+
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
124156
dockers:
125157
- goos: linux
126158
goarch: amd64
@@ -170,6 +202,22 @@ dockers:
170202
- "--label=org.opencontainers.image.title=mytoken-migratedb"
171203
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
172204
- "--label=org.opencontainers.image.version={{.Version}}"
205+
- goos: linux
206+
goarch: amd64
207+
ids:
208+
- notifier-server
209+
image_templates:
210+
- "oidcmytoken/mytoken-notifier-server:latest"
211+
- "oidcmytoken/mytoken-notifier-server:{{ .Tag }}"
212+
- "oidcmytoken/mytoken-notifier-server:v{{ .Major }}"
213+
- "oidcmytoken/mytoken-notifier-server:v{{ .Major }}.{{ .Minor }}"
214+
dockerfile: cmd/mytoken-server/mytoken-notifier-server/Dockerfile
215+
build_flag_templates:
216+
- "--pull"
217+
- "--label=org.opencontainers.image.created={{.Date}}"
218+
- "--label=org.opencontainers.image.title=mytoken-notifier-server"
219+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
220+
- "--label=org.opencontainers.image.version={{.Version}}"
173221
checksum:
174222
name_template: 'checksums.txt'
175223
snapshot:

.goreleaser.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ builds:
3434
flags:
3535
- -trimpath
3636
mod_timestamp: '{{ .CommitTimestamp }}'
37+
- id: notifier-server
38+
main: ./cmd/mytoken-server/mytoken-notifier-server
39+
binary: mytoken-notifier-server
40+
env:
41+
- CGO_ENABLED=0
42+
goos:
43+
- linux
44+
flags:
45+
- -trimpath
46+
mod_timestamp: '{{ .CommitTimestamp }}'
3747
archives:
3848
- name_template: >-
3949
{{ .ProjectName }}_{{ .Version }}_
@@ -121,13 +131,36 @@ nfpms:
121131
file_name_template: >-
122132
{{ .PackageName }}-{{ .Version }}.
123133
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
134+
- id: notifier-pkg
135+
package_name: mytoken-notifier-server
136+
file_name_template: >-
137+
{{ .PackageName }}_{{ .Version }}_
138+
{{- if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}
139+
builds:
140+
- notifier-server
141+
homepage: https://mytoken-docs.data.kit.edu/server
142+
maintainer: Gabriel Zachmann <[email protected]>
143+
description: A standalone notifier server for mytoken notifications
144+
license: MIT
145+
formats:
146+
- deb
147+
- rpm
148+
release: "1"
149+
section: misc
150+
bindir: /usr/bin
151+
overrides:
152+
rpm:
153+
file_name_template: >-
154+
{{ .PackageName }}-{{ .Version }}.
155+
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
124156
dockers:
125157
- goos: linux
126158
goarch: amd64
127159
ids:
128160
- server
129161
image_templates:
130162
- "oidcmytoken/mytoken-server:unstable"
163+
- "oidcmytoken/mytoken-server:prerel"
131164
- "oidcmytoken/mytoken-server:{{ .Tag }}"
132165
dockerfile: cmd/mytoken-server/Dockerfile
133166
build_flag_templates:
@@ -142,6 +175,7 @@ dockers:
142175
- setup
143176
image_templates:
144177
- "oidcmytoken/mytoken-setup:unstable"
178+
- "oidcmytoken/mytoken-setup:prerel"
145179
- "oidcmytoken/mytoken-setup:{{ .Tag }}"
146180
dockerfile: cmd/mytoken-server/mytoken-setup/Dockerfile
147181
build_flag_templates:
@@ -156,6 +190,7 @@ dockers:
156190
- migratedb
157191
image_templates:
158192
- "oidcmytoken/mytoken-migratedb:unstable"
193+
- "oidcmytoken/mytoken-migratedb:prerel"
159194
- "oidcmytoken/mytoken-migratedb:{{ .Tag }}"
160195
dockerfile: cmd/mytoken-server/mytoken-migratedb/Dockerfile
161196
build_flag_templates:
@@ -164,6 +199,21 @@ dockers:
164199
- "--label=org.opencontainers.image.title=mytoken-migratedb"
165200
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
166201
- "--label=org.opencontainers.image.version={{.Version}}"
202+
- goos: linux
203+
goarch: amd64
204+
ids:
205+
- notifier-server
206+
image_templates:
207+
- "oidcmytoken/mytoken-notifier-server:unstable"
208+
- "oidcmytoken/mytoken-notifier-server:prerel"
209+
- "oidcmytoken/mytoken-notifier-server:{{ .Tag }}"
210+
dockerfile: cmd/mytoken-server/mytoken-notifier-server/Dockerfile
211+
build_flag_templates:
212+
- "--pull"
213+
- "--label=org.opencontainers.image.created={{.Date}}"
214+
- "--label=org.opencontainers.image.title=mytoken-notifier-server"
215+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
216+
- "--label=org.opencontainers.image.version={{.Version}}"
167217
checksum:
168218
name_template: 'checksums.txt'
169219
snapshot:

CHANGELOG.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,59 @@
1212
<!-- ### Dependencies -->
1313
<!-- -->
1414

15+
16+
## mytoken 0.10.0
17+
18+
### Features
19+
20+
- Add support for notifications:
21+
- Allows to create email notifications for various things
22+
- Allows to calendar invites for token expirations
23+
- Allows to create calendars and add token expirations to it; the ics feed can be subscribed to
24+
- Allows to manage notifications on the web-interface
25+
- Add "Enforceable Restrictions"
26+
- Depending on a user attribute different restriction templates can be
27+
enforced
28+
- Add possibility to have an healthcheck endpoint
29+
30+
### Enhancements
31+
32+
- In the tokeninfo pane in the webinterface expired JWTs now get a more precise badge.
33+
- Improved on returning json errors instead of html on api paths
34+
- When not being logged in and no OP was selected now the 'Create new Mytoken' button in the webinterface is disabled.
35+
36+
### Bugfixes
37+
38+
- Fixed an issue with parallel access to refresh tokens if token rotation is used; this problem could for example
39+
occur with EGI-checkin.
40+
- Fixed unwanted behavior: If a profile was used and changes to the mytoken
41+
spec would be made in the consent screen that would narrow it down, the
42+
profile would still be applied.
43+
- Fixed problems with the caching implementation.
44+
45+
### Other
46+
47+
- Changed CORP settings for `/api` and `/static` as this lead to problems with oidc-agent.
48+
49+
### Dependencies
50+
51+
- Bump go version from 1.19 to 1.22
52+
- Bump github.com/coreos/go-oidc/v3 from 3.9.0 to 3.11.0
53+
- Bump github.com/gliderlabs/ssh from 0.3.6 to 0.3.7
54+
- Bump github.com/go-resty/resty/v2 from 2.11.0 to 2.16.2
55+
- Bump github.com/go-sql-driver/mysql from 1.8.0 to 1.8.1
56+
- Bump github.com/gofiber/fiber/v2 from 2.52.2 to 2.52.5
57+
- Bump github.com/gofiber/template/mustache/v2 from 2.0.9 to 2.0.12
58+
- Bump github.com/jmoiron/sqlx from 1.3.5 to 1.4.0
59+
- Bump github.com/lestrrat-go/jwx from 1.2.29 to 1.2.30
60+
- Bump github.com/pires/go-proxyproto from 0.7.0 to 0.8.0
61+
- Bump github.com/redis/go-redis/v9 from 9.5.1 to 9.7.0
62+
- Bump github.com/valyala/fasthttp from 1.52.0 to 1.57.0
63+
- Bump golang.org/x/crypto from 0.21.0 to 0.30.0
64+
- Bump golang.org/x/mod from 0.16.0 to 0.22.0
65+
- Bump golang.org/x/oauth2 from 0.18.0 to 0.24.0
66+
- Bump golang.org/x/term from 0.18.0 to 0.27.0
67+
1568
## mytoken 0.9.2
1669

1770
### Packaging
@@ -28,12 +81,12 @@
2881
- Bump golang.org/x/mod from 0.15.0 to 0.16.0
2982
- Bump golang.org/x/oauth2 from 0.17.0 to 0.18.0
3083
- Bump golang.org/x/term from 0.17.0 to 0.18.0
31-
84+
-
3285
## mytoken 0.9.1
3386

3487
### Enhancements
3588

36-
- Improfile includes handling in the webitnerface restrictions editor.
89+
- Improve includes handling in the webinterface restrictions editor.
3790

3891
### Dependencies
3992

0 commit comments

Comments
 (0)