Skip to content

Commit 2aee91f

Browse files
authored
0.7 (#204)
2 parents 8afc1a8 + 6753c8a commit 2aee91f

File tree

192 files changed

+3253
-2555
lines changed

Some content is hidden

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

192 files changed

+3253
-2555
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ updates:
1010
schedule:
1111
interval: "daily"
1212
open-pull-requests-limit: 15
13-
target-branch: "prerelease"

.gitlab-ci-scripts/goreleaser.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ first=$(grep '^## ' -nm1 CHANGELOG.md | cut -d':' -f1); \
33
second=$(grep '^## ' -nm2 CHANGELOG.md | tail -n1 | cut -d':' -f1); \
44
tail -n+$first CHANGELOG.md | head -n$(($second-$first)) > ../shared/release.md
55
GORELEASER_CONFIG=".goreleaser.yml"
6-
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '-'; then
6+
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then
77
GORELEASER_CONFIG=".goreleaser-release.yml"
88
fi
99
BASEDIR=/go/src/github.com/oidc-mytoken/server

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

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/sh
2+
3+
DEVSTRING="pr"
4+
VERSION_FILE=internal/model/version/VERSION
5+
6+
while [ $# -gt 0 ]; do
7+
case $1 in
8+
--devstring)
9+
DEVSTRING="$2"
10+
shift # past argument
11+
shift # past value
12+
;;
13+
--version_file)
14+
VERSION_FILE="$2"
15+
shift # past argument
16+
shift # past value
17+
;;
18+
--*|-*)
19+
echo "Unknown option $1"
20+
exit 1
21+
;;
22+
esac
23+
done
24+
25+
git config user.email || {
26+
echo "Setting up git in CI"
27+
git config --global --add safe.directory "$PWD"
28+
git config user.email "[email protected]"
29+
git config user.name "cicd"
30+
}
31+
32+
# Get master branch name:
33+
# use origin if exists
34+
# else use last found remote
35+
REMOTES=$(git remote show)
36+
for R in $REMOTES; do
37+
MASTER=master
38+
MASTER_BRANCH="refs/remotes/${R}/${MASTER}"
39+
#echo "Master-branch: ${MASTER_BRANCH}"
40+
[ "x${R}" = "xorigin" ] && break
41+
done
42+
43+
PREREL=$(git rev-list --count HEAD ^"$MASTER_BRANCH")
44+
45+
# use version file:
46+
VERSION=$(cat "$VERSION_FILE")
47+
PR_VERSION="${VERSION}-${DEVSTRING}${PREREL}"
48+
echo "$PR_VERSION" > "$VERSION_FILE"
49+
echo "$PR_VERSION"
50+
51+
echo "$PR_VERSION" > "$VERSION_FILE"
52+
git add "$VERSION_FILE"
53+
git commit -m "dummy prerel version"
54+
git tag "v${PR_VERSION}"

.gitlab-ci-scripts/upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
REPO_TARGET="/prerel"
3-
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '-'; then
3+
if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then
44
REPO_TARGET="/preprod"
55
fi
66

.gitlab-ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ stages:
44
- test
55
- lint
66
- release
7+
- deploy
78

89
default:
910
tags:
@@ -27,12 +28,12 @@ test_race:
2728
script:
2829
- go test -race -v ./...
2930

30-
lint:
31+
staticcheck:
3132
stage: lint
3233
before_script:
33-
- go install golang.org/x/lint/golint@latest
34+
- go install honnef.co/go/tools/cmd/staticcheck@latest
3435
script:
35-
- golint -set_exit_status ./...
36+
- staticcheck ./...
3637

3738
vet:
3839
stage: lint
@@ -72,8 +73,18 @@ prerelease:
7273
REPO_HOST: repo.data.kit.edu
7374
REPO_USER: cicd
7475
script:
75-
- if [ -z "$CI_COMMIT_TAG" ]; then docker run --rm -v $PWD:/tmp/mytoken -w /tmp/mytoken bitnami/git .gitlab-ci-scripts/set-prerel-version; fi;
76+
- if [ -z "$CI_COMMIT_TAG" ]; then docker run --rm -v $PWD:/tmp/mytoken -w /tmp/mytoken bitnami/git .gitlab-ci-scripts/set-prerel-version.sh; fi;
7677
- .gitlab-ci-scripts/goreleaser.sh
7778
- .gitlab-ci-scripts/upload.sh
7879
after_script:
7980
- docker run --rm curlimages/curl -d "repo=github.com/oidc-mytoken/server" https://goreportcard.com/checks
81+
82+
deploy-dev:
83+
stage: deploy
84+
before_script:
85+
- mkdir -p /root/.ssh
86+
- cp $KNOWN_HOSTS /root/.ssh/known_hosts
87+
- cp $DEPLOYMENT_SSH_KEY /root/.ssh/id_ed25519 && chmod 0600 /root/.ssh/id_ed25519
88+
script:
89+
- ssh mytoken-dev.vm.fedcloud.eu
90+

CHANGELOG.md

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

15+
## mytoken 0.7.0
16+
17+
### Features
18+
19+
- Webinterface has option to show event history for other mytokens in mytoken list.
20+
- Webinterface has a new option in the tokeninfo pane to create a new mytoken with the same properties.
21+
- Added server side `profiles` and `templates`
22+
- Can be used in the API, i.e. mytoken requests can include profiles, the capability, restrictions, and rotation
23+
claims can use templates
24+
- Can be used in the webinterface
25+
26+
### Enhancements
27+
28+
- Improved responsiveness of webinterface
29+
- Expired mytokens are now greyed-out in webinterface mytoken list
30+
- The database auto-cleanup now only removes mytokens expired more than a month ago.
31+
- This allows expired tokens to be shown in a mytoken list for extended periods.
32+
- This also allows to obtain history for expired tokens (by using a mytoken with the `manage_mytokens:list`
33+
capability) for a longer time.
34+
- Mytokens are still directly deleted when revoked.
35+
- Requests from private IPs (e.g. from within the same entwork where the server is located) are now geolocated to
36+
the country where the server stands.
37+
- The 'Create Mytoken' tab in the webitnerface now supports an `r` query parameter that takes a base64 encoded
38+
request from which the form is prefilled.
39+
- This allows 'create-a-mytoken-with-these-properties' links.
40+
41+
### API
42+
43+
- Added profile endpoint:
44+
- Any user can get list of groups
45+
- Any user can get profiles, and templates (capabilities, restrictions, rotation) for all the groups
46+
- Groups credentials are defined in the config file
47+
- With Basic authentication profiles and templates for the authenticated group can be created, updated, and deleted.
48+
- Renamed `revocation_id` to `mom_id`
49+
- Restructured capabilities related to other mytokens
50+
- Added possibility to obtain history information for children and other tokens (capability)
51+
- Added a name for OPs in the `supported_providers` of the mytoken configuration endpoint
52+
53+
### Bugfixes
54+
55+
- Fixed a bug where transfer codes could be used just like a short token (but only while the transfer code did not
56+
expire)
57+
1558
## mytoken 0.6.1
1659

1760
### API

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2022 Gabriel Zachmann
3+
Copyright (c) 2020-2023 Gabriel Zachmann
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

cmd/mytoken-server/main.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ import (
66
"os/signal"
77
"syscall"
88

9+
"github.com/oidc-mytoken/utils/httpclient"
910
log "github.com/sirupsen/logrus"
1011

11-
"github.com/oidc-mytoken/server/internal/db/dbrepo/versionrepo"
12-
"github.com/oidc-mytoken/server/internal/endpoints/settings"
13-
"github.com/oidc-mytoken/server/internal/model/version"
14-
"github.com/oidc-mytoken/server/internal/utils/cookies"
15-
"github.com/oidc-mytoken/server/shared/httpclient"
16-
1712
"github.com/oidc-mytoken/server/internal/config"
1813
"github.com/oidc-mytoken/server/internal/db"
14+
"github.com/oidc-mytoken/server/internal/db/dbrepo/versionrepo"
1915
configurationEndpoint "github.com/oidc-mytoken/server/internal/endpoints/configuration"
16+
"github.com/oidc-mytoken/server/internal/endpoints/settings"
2017
"github.com/oidc-mytoken/server/internal/jws"
18+
"github.com/oidc-mytoken/server/internal/model/version"
2119
"github.com/oidc-mytoken/server/internal/oidc/authcode"
2220
"github.com/oidc-mytoken/server/internal/server"
21+
"github.com/oidc-mytoken/server/internal/utils/cookies"
2322
"github.com/oidc-mytoken/server/internal/utils/geoip"
2423
loggerUtils "github.com/oidc-mytoken/server/internal/utils/logger"
2524
)

cmd/mytoken-server/mytoken-migratedb/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"time"
88

99
"github.com/Songmu/prompter"
10+
"github.com/oidc-mytoken/utils/utils/fileutil"
1011
log "github.com/sirupsen/logrus"
1112
"github.com/urfave/cli/v2"
1213
"golang.org/x/term"
1314

1415
"github.com/oidc-mytoken/server/internal/config"
1516
"github.com/oidc-mytoken/server/internal/db"
1617
"github.com/oidc-mytoken/server/internal/model/version"
17-
"github.com/oidc-mytoken/server/shared/utils/fileutil"
1818
)
1919

2020
var configFile string
@@ -116,7 +116,7 @@ var app = &cli.App{
116116
},
117117
},
118118
Action: func(context *cli.Context) error {
119-
mytokenNodes := []string{}
119+
var mytokenNodes []string
120120
if context.Args().Len() > 0 {
121121
mytokenNodes = context.Args().Slice()
122122
} else if configFile != "" {

0 commit comments

Comments
 (0)