Skip to content

Commit

Permalink
Merge pull request #56 from oidc-mytoken/prerel
Browse files Browse the repository at this point in the history
0.6.1
  • Loading branch information
zachmann authored Jul 31, 2024
2 parents 3af6272 + e11cab9 commit f515bb8
Show file tree
Hide file tree
Showing 19 changed files with 191 additions and 96 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/codebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: codebase-sync

on:
- push
- delete

jobs:
sync:
runs-on: ubuntu-latest
name: Git Repo Sync
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wangchucheng/git-repo-sync@v0.1.0
with:
# Such as https://github.com/wangchucheng/git-repo-sync.git
target-url: https://codebase.helmholtz.cloud/m-team/oidc/mytoken/client.git
# Such as wangchucheng
target-username: gabriel.zachmann
# You can store token in your project's 'Setting > Secrets' and reference the name here. Such as ${{ secrets.ACCESS_TOKEN }}
target-token: ${{ secrets.CODEBASE_TOKEN }}
10 changes: 1 addition & 9 deletions .gitlab-ci-scripts/goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,5 @@ if [ -n "$CI_COMMIT_TAG" ] && echo "$CI_COMMIT_TAG" | grep -qv '~'; then
GORELEASER_CONFIG=".goreleaser-release.yml"
fi
BASEDIR=/go/src/github.com/oidc-mytoken/client
docker run --rm --privileged \
-v "$PWD":"$BASEDIR" \
-w "$BASEDIR" \
-v "${PWD}/../shared":/tmp/shared \
-v /var/run/docker.sock:/var/run/docker.sock \
-e DOCKER_USERNAME -e DOCKER_PASSWORD \
-e GITHUB_TOKEN \
-e GORELEASER_CONFIG \
goreleaser/goreleaser release -f $GORELEASER_CONFIG --release-notes /tmp/shared/release.md
goreleaser release -f $GORELEASER_CONFIG --release-notes ../shared/release.md
ls -l results
20 changes: 15 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
image: golang:1.16
include:
- 'https://codebase.helmholtz.cloud/m-team/tools/ci-voodoo/-/raw/master/ci-include/github-status-sync.yml'

variables:
UPSTREAM_PROJECT: oidc-mytoken/client

image: golang:1.22
stages:
- build
- test
Expand Down Expand Up @@ -28,7 +34,7 @@ test_race:
- go test -race -v ./...

staticcheck:
image: golang:1.19
image: golang:1.22
stage: lint
before_script:
- go install honnef.co/go/tools/cmd/staticcheck@latest
Expand All @@ -48,7 +54,8 @@ build:
prerelease:
stage: release
image:
name: docker:stable
name: goreleaser/goreleaser
entrypoint: [""]
services:
- docker:dind
only:
Expand All @@ -62,9 +69,12 @@ prerelease:
GIT_DEPTH: 0
REPO_HOST: repo.data.kit.edu
REPO_USER: cicd
DOCKER_REGISTRY: https://index.docker.io/v1/
before_script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
script:
- 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;
- if [ -z "$CI_COMMIT_TAG" ]; then .gitlab-ci-scripts/set-prerel-version.sh; fi;
- .gitlab-ci-scripts/goreleaser.sh
- .gitlab-ci-scripts/upload.sh
after_script:
- docker run --rm curlimages/curl -d "repo=github.com/oidc-mytoken/client" https://goreportcard.com/checks
- curl -d "repo=github.com/oidc-mytoken/client" https://goreportcard.com/checks
25 changes: 12 additions & 13 deletions .goreleaser-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ builds:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- replacements:
darwin: macOS
386: 32-bit
amd64: 64-bit
- name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{ if eq .Os "darwin" }}macOS{{- else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "386" }}32-bit{{- else if eq .Arch "amd64" }}64-bit{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
format: zip
nfpms:
- id: client-pkg
package_name: mytoken
replacements:
386: i386
file_name_template: "{{ .PackageName }}_{{ .Version }}_{{ .Arch }}"
file_name_template: >-
{{ .PackageName }}_{{ .Version }}_
{{- if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}
builds:
- client
homepage: https://mytoken-docs.data.kit.edu/
Expand All @@ -42,18 +42,18 @@ nfpms:
formats:
- deb
- rpm
release: 1
release: "1"
section: misc
bindir: /usr/bin
contents:
- src: config/example-config.yaml
dst: /etc/mytoken/example-config.yaml
dst: /usr/share/doc/mytoken/example-config.yaml
type: config
overrides:
rpm:
replacements:
amd64: x86_64
file_name_template: "{{ .PackageName }}-{{ .Version }}.{{ .Arch }}"
file_name_template: >-
{{ .PackageName }}-{{ .Version }}.
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
dockers:
- goos: linux
goarch: amd64
Expand All @@ -77,7 +77,6 @@ checksum:
snapshot:
name_template: "{{ .Tag }}-next"
release:
disable: true
prerelease: auto
draft: true
github:
Expand Down
24 changes: 12 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ builds:
- -trimpath
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- replacements:
darwin: macOS
386: 32-bit
amd64: 64-bit
- name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{ if eq .Os "darwin" }}macOS{{- else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "386" }}32-bit{{- else if eq .Arch "amd64" }}64-bit{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
format: zip
nfpms:
- id: client-pkg
package_name: mytoken
replacements:
386: i386
file_name_template: "{{ .PackageName }}_{{ .Version }}_{{ .Arch }}"
file_name_template: >-
{{ .PackageName }}_{{ .Version }}_
{{- if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}
builds:
- client
homepage: https://mytoken-docs.data.kit.edu/
Expand All @@ -42,18 +42,18 @@ nfpms:
formats:
- deb
- rpm
release: 1
release: "1"
section: misc
bindir: /usr/bin
contents:
- src: config/example-config.yaml
dst: /etc/mytoken/example-config.yaml
dst: /usr/share/doc/mytoken/example-config.yaml
type: config
overrides:
rpm:
replacements:
amd64: x86_64
file_name_template: "{{ .PackageName }}-{{ .Version }}.{{ .Arch }}"
file_name_template: >-
{{ .PackageName }}-{{ .Version }}.
{{- if eq .Arch "386" }}i386{{- else if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }}
dockers:
- goos: linux
goarch: amd64
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

## mytoken 0.6.0 PREREL
## mytoken 0.6.1
- Fail on restrictions error
- Added possibility to revoke tokens by `mom_id`
- Updated lib / api
- Updated dependecies
- Don't fail if defult mytoken server is down but another JWT is used.

## mytoken 0.6.0

### Breaking Changes
- Support for local profiles / templates is dropped. Instead, support for server profiles is added.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 Gabriel Zachmann
Copyright (c) 2020-2024 Gabriel Zachmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 33 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
module github.com/oidc-mytoken/client

go 1.16
go 1.22

require (
github.com/Songmu/prompter v0.5.1
github.com/gliderlabs/ssh v0.3.5
github.com/mdp/qrterminal/v3 v3.0.0
github.com/oidc-mytoken/api v0.10.0
github.com/oidc-mytoken/lib v0.7.0
github.com/gliderlabs/ssh v0.3.7
github.com/mdp/qrterminal/v3 v3.2.0
github.com/oidc-mytoken/api v0.11.1
github.com/oidc-mytoken/lib v0.7.1
github.com/oidc-mytoken/utils v0.1.2
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli/v2 v2.3.1-0.20211205195634-e8d81738896c
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035
golang.org/x/net v0.27.0
golang.org/x/term v0.22.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/coreos/go-oidc/v3 v3.4.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.41.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect
golang.org/x/sys v0.22.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
rsc.io/qr v0.2.0 // indirect
)

replace github.com/urfave/cli/v2 => github.com/zachmann/cli/v2 v2.3.1-0.20211220102037-d619fd40a704
Loading

0 comments on commit f515bb8

Please sign in to comment.