From f315ec54e67c5d247721c1313a455a686b3d4168 Mon Sep 17 00:00:00 2001 From: Gabriel Zachmann Date: Fri, 6 Sep 2024 16:37:29 +0200 Subject: [PATCH 1/9] version bump --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ce7f2b42..c0baecba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.2.2 +5.2.3 From 0f237ef6c0ca04d83a762a65db378b11a8097e28 Mon Sep 17 00:00:00 2001 From: zachmann Date: Mon, 9 Sep 2024 11:45:29 +0200 Subject: [PATCH 2/9] remove lgtm.yml --- lgtm.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 lgtm.yml diff --git a/lgtm.yml b/lgtm.yml deleted file mode 100644 index 50f2dd41..00000000 --- a/lgtm.yml +++ /dev/null @@ -1,5 +0,0 @@ -path_classifiers: - library: - - lib -queries: - - include: cpp/ From e1b066b2ae7610cba2e43f346253070e37febc73 Mon Sep 17 00:00:00 2001 From: zachmann Date: Mon, 7 Oct 2024 16:41:15 +0200 Subject: [PATCH 3/9] [fix] fixed a bug where oidc-token would segfault --- CHANGELOG.md | 11 +++++++++-- src/ipc/ipc.c | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af231ca1..1847a132 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,19 @@ +## oidc-agent 5.2.3 + +### Bugfixes + +- Fixed a bug where `oidc-token` would segfault if the account was not known. + ## oidc-agent 5.2.2 ### Bugfixes -- Fixed a bug where `oidc-agent` would crash due to a segmentation fault if `~/.config/oidc-agent/issuer.config` was not present. - +- Fixed a bug where `oidc-agent` would crash due to a segmentation fault if `~/.config/oidc-agent/issuer.config` was not + present. + ## oidc-agent 5.2.1 ### Bugfixes diff --git a/src/ipc/ipc.c b/src/ipc/ipc.c index 9fff9e83..3fb59a36 100644 --- a/src/ipc/ipc.c +++ b/src/ipc/ipc.c @@ -126,7 +126,7 @@ oidc_error_t ipc_client_init(struct connection* con, unsigned char remote) { char* path = getRegistryValue(env_var_name); #else char* path = oidc_strcopy(getenv(env_var_name)); - if (path == NULL) { + if (path == NULL && remote == 0) { path = defaultSocketPath(); usedDefault = 1; } From e9ee73bed6ff7410155ce2b73fc385fcbd453e59 Mon Sep 17 00:00:00 2001 From: zachmann Date: Tue, 8 Oct 2024 11:05:37 +0200 Subject: [PATCH 4/9] [docu] add docu about wsl --- gitbook/installation/windows.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gitbook/installation/windows.md b/gitbook/installation/windows.md index 7dc96403..1a9affa4 100644 --- a/gitbook/installation/windows.md +++ b/gitbook/installation/windows.md @@ -1,6 +1,31 @@ ## Installation +### Using WSL + +On a modern Windows system with WSL2 (verified, WSL1 **might** work) +`oidc-agent` can be used through WSL: + +- If not already done install WSL according to https://learn.microsoft.com/en-us/windows/wsl/install +- Add the `oidc-agent` repo and install according to http://repo.data.kit.edu for your chosen distribution +- Add `eval $(oidc-agent-service use)` to your `.bashrc` +- Now `oidc-agent` and friends can be used from the WSL and windows shell as + used to, e.g. + +```shell +# From WSL +oidc-token + +# From Powershell +wsl oidc-token +``` + +### "Native" Installer + We provide an installer for oidc-agent at: [http://repo.data.kit.edu/windows/oidc-agent/](http://repo.data.kit.edu/windows/oidc-agent/). -The installer will install all necessary binaries and libraries and oidc-agent is ready to use. \ No newline at end of file +The installer will install all necessary binaries and libraries and oidc-agent is ready to use. + +We recommend to use the WSL method instead and only use this is installer if +WSL is not possible. +It is likely that support for this installer is dropped in the future. \ No newline at end of file From 4570b5278c16be40bb0c787818475caa10c18a75 Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 23 Oct 2024 13:02:07 +0200 Subject: [PATCH 5/9] dont show help on stderr --- src/oidc-tokensh/oidc-tokensh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oidc-tokensh/oidc-tokensh b/src/oidc-tokensh/oidc-tokensh index c812874a..59521ce5 100755 --- a/src/oidc-tokensh/oidc-tokensh +++ b/src/oidc-tokensh/oidc-tokensh @@ -25,7 +25,7 @@ usage() echo " -v|--verbose show debug output" echo "" echo "command defaults to \$SHELL" -} >&2 +} # if [ $# = 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then # echo "[${LINENO}] You ran: $0 $*" From 0bf1de20fca39ff190fe75353703e256e069fefb Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 23 Oct 2024 13:02:19 +0200 Subject: [PATCH 6/9] manpage for oidc-tokensh --- src/h2m/oidc-tokensh.h2m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/h2m/oidc-tokensh.h2m diff --git a/src/h2m/oidc-tokensh.h2m b/src/h2m/oidc-tokensh.h2m new file mode 100644 index 00000000..adb66af2 --- /dev/null +++ b/src/h2m/oidc-tokensh.h2m @@ -0,0 +1,17 @@ +[NAME] +oidc-tokensh \- Ensure that valid Access Tokens are always available + +oidc-tokensh starts a new shell within which oidc-agent is available. It +prompts for a password to unlock an account configuration, when necessary. + +Access Tokens are automatically renewed for the specified account, before +they expire. + +[FILES] +$XDG_RUNTIME_DIR/bt_u$ID, /tmp/bt_u$ID, or $BEARER_TOKEN_FILE +[SEE ALSO] +oidc-agent(1), oidc-add(1), oidc-token(1) +.PP +Low-traffic mailing list with updates such as critical security incidents and new releases: https://www.lists.kit.edu/sympa/subscribe/oidc-agent-user +.PP +Full documentation can be found at https://indigo-dc.gitbooks.io/oidc-agent/user/oidc-tokensh From b45b18363afe6b3d9176fb2f04b95a064b0d6ce7 Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 23 Oct 2024 13:08:06 +0200 Subject: [PATCH 7/9] add manpage and gitbook for tokensh --- Makefile | 13 ++++++++++--- gitbook/SUMMARY.md | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 643a0310..3e811071 100644 --- a/Makefile +++ b/Makefile @@ -564,7 +564,7 @@ install_bash: $(BASH_COMPLETION_PATH)/$(AGENT) $(BASH_COMPLETION_PATH)/$(GEN) $( @echo "Installed bash completion" .PHONY: install_man -install_man: $(MAN_PATH)/man1/$(AGENT).1 $(MAN_PATH)/man1/$(GEN).1 $(MAN_PATH)/man1/$(ADD).1 $(MAN_PATH)/man1/$(CLIENT).1 $(MAN_PATH)/man1/$(AGENT_SERVICE).1 $(MAN_PATH)/man1/$(KEYCHAIN).1 $(PROMPT_MAN_PATH)/man1/$(PROMPT).1 +install_man: $(MAN_PATH)/man1/$(AGENT).1 $(MAN_PATH)/man1/$(GEN).1 $(MAN_PATH)/man1/$(ADD).1 $(MAN_PATH)/man1/$(CLIENT).1 $(MAN_PATH)/man1/$(AGENT_SERVICE).1 $(MAN_PATH)/man1/$(KEYCHAIN).1 $(PROMPT_MAN_PATH)/man1/$(PROMPT).1 $(MAN_PATH)/man1/$(TOKENSH).1 @echo "Installed man pages!" .PHONY: install_lib @@ -718,6 +718,8 @@ $(MAN_PATH)/man1/$(KEYCHAIN).1: $(MANDIR)/$(KEYCHAIN).1 $(MAN_PATH)/man1 @install -p -m 644 $< $@ $(PROMPT_MAN_PATH)/man1/$(PROMPT).1: $(MANDIR)/$(PROMPT).1 $(PROMPT_MAN_PATH)/man1 @install -p -m 644 $< $@ +$(MAN_PATH)/man1/$(TOKENSH).1: $(MANDIR)/$(TOKENSH).1 $(MAN_PATH)/man1 + @install -p -m 644 $< $@ ## Tmpfiles $(TMPFILES_PATH)/oidc-agent.conf: $(CONFDIR)/tmpfiles.d/oidc-agent.conf @@ -804,6 +806,7 @@ uninstall_man: @$(rm) $(MAN_PATH)/man1/$(CLIENT).1 @$(rm) $(MAN_PATH)/man1/$(AGENT_SERVICE).1 @$(rm) $(MAN_PATH)/man1/$(KEYCHAIN).1 + @$(rm) $(MAN_PATH)/man1/$(TOKENSH).1 @$(rm) $(PROMPT_MAN_PATH)/man1/$(PROMPT).1 @echo "Uninstalled man pages!" @@ -858,7 +861,7 @@ uninstall_xsession_script: # Man pages .PHONY: create_man -create_man: $(MANDIR)/$(AGENT).1 $(MANDIR)/$(GEN).1 $(MANDIR)/$(ADD).1 $(MANDIR)/$(CLIENT).1 $(MANDIR)/$(AGENT_SERVICE).1 $(MANDIR)/$(KEYCHAIN).1 $(MANDIR)/$(PROMPT).1 +create_man: $(MANDIR)/$(AGENT).1 $(MANDIR)/$(GEN).1 $(MANDIR)/$(ADD).1 $(MANDIR)/$(CLIENT).1 $(MANDIR)/$(AGENT_SERVICE).1 $(MANDIR)/$(KEYCHAIN).1 $(MANDIR)/$(PROMPT).1 $(MANDIR)/$(TOKENSH).1 @echo "Created man pages" $(MANDIR)/$(AGENT).1: $(MANDIR) $(BINDIR)/$(AGENT) $(SRCDIR)/h2m/$(AGENT).h2m @@ -882,6 +885,9 @@ $(MANDIR)/$(KEYCHAIN).1: $(MANDIR) $(BINDIR)/$(KEYCHAIN) $(SRCDIR)/h2m/$(KEYCHAI $(MANDIR)/$(PROMPT).1: $(MANDIR) $(BINDIR)/$(PROMPT) $(SRCDIR)/h2m/$(PROMPT).h2m @help2man $(BINDIR)/$(PROMPT) -o $(MANDIR)/$(PROMPT).1 -s 1 -N -i $(SRCDIR)/h2m/$(PROMPT).h2m --no-discard-stderr +$(MANDIR)/$(TOKENSH).1: $(MANDIR) $(BINDIR)/$(TOKENSH) $(SRCDIR)/h2m/$(TOKENSH).h2m + @help2man $(BINDIR)/$(TOKENSH) -o $(MANDIR)/$(TOKENSH).1 -s 1 -N -i $(SRCDIR)/h2m/$(TOKENSH).h2m + endif # Library @@ -1081,8 +1087,9 @@ test: $(TESTBINDIR)/test @$< .PHONY: testdocu -testdocu: $(BINDIR)/$(AGENT) $(BINDIR)/$(GEN) $(BINDIR)/$(ADD) $(BINDIR)/$(CLIENT) gitbook/$(GEN)/options.md gitbook/$(AGENT)/options.md gitbook/$(ADD)/options.md gitbook/$(CLIENT)/options.md +testdocu: $(BINDIR)/$(AGENT) $(BINDIR)/$(GEN) $(BINDIR)/$(ADD) $(BINDIR)/$(CLIENT) gitbook/$(GEN)/options.md gitbook/$(AGENT)/options.md gitbook/$(ADD)/options.md gitbook/$(CLIENT)/options.md gitbook/$(TOKENSH)/options.md @$(BINDIR)/$(AGENT) -h | grep "^[[:space:]]*-" | grep -v "debug" | grep -v "verbose" | grep -v "usage" | grep -v "help" | grep -v "version" | sed 's/\s*--/--/' | sed 's/[^\s]*,--/--/' | sed 's/\s.*//' | sed 's/\[.*//' | sed 's/,.*//' | sed 's/=.*//' | xargs -I {} sh -c 'grep -c -- ^###.*{} gitbook/$(AGENT)/options.md>/dev/null || echo "In gitbook/$(AGENT)/options.md: {} not documented"' @$(BINDIR)/$(GEN) -h | grep "^[[:space:]]*-" | grep -v "debug" | grep -v "verbose" | grep -v "usage" | grep -v "help" | grep -v "version" | sed 's/\s*--/--/' | sed 's/[^\s]*,--/--/' | sed 's/\s.*//' | sed 's/\[.*//' | sed 's/,.*//' | sed 's/=.*//' | xargs -I {} sh -c 'grep -c -- ^###.*{} gitbook/$(GEN)/options.md>/dev/null || echo "In gitbook/$(GEN)/options.md: {} not documented"' @$(BINDIR)/$(ADD) -h | grep "^[[:space:]]*-" | grep -v "debug" | grep -v "verbose" | grep -v "usage" | grep -v "help" | grep -v "version" | sed 's/\s*--/--/' | sed 's/[^\s]*,--/--/' | sed 's/\s.*//' | sed 's/\[.*//' | sed 's/,.*//' | sed 's/=.*//' | xargs -I {} sh -c 'grep -c -- ^###.*{} gitbook/$(ADD)/options.md>/dev/null || echo "In gitbook/$(ADD)/options.md: {} not documented"' @$(BINDIR)/$(CLIENT) -h | grep "^[[:space:]]*-" | grep -v "debug" | grep -v "verbose" | grep -v "usage" | grep -v "help" | grep -v "version" | sed 's/\s*--/--/' | sed 's/[^\s]*,--/--/' | sed 's/\s.*//' | sed 's/\[.*//' | sed 's/,.*//' | sed 's/=.*//' | xargs -I {} sh -c 'grep -c -- ^###.*{} gitbook/$(CLIENT)/options.md>/dev/null || echo "In gitbook/$(CLIENT)/options.md: {} not documented"' + @$(BINDIR)/$(TOKENSH) -h | grep "^[[:space:]]*-" | grep -v "debug" | grep -v "verbose" | grep -v "usage" | grep -v "help" | grep -v "version" | sed 's/\s*--/--/' | sed 's/[^\s]*,--/--/' | sed 's/\s.*//' | sed 's/\[.*//' | sed 's/,.*//' | sed 's/=.*//' | xargs -I {} sh -c 'grep -c -- ^###.*{} gitbook/$(TOKENSH)/options.md>/dev/null || echo "In gitbook/$(TOKENSH)/options.md: {} not documented"' diff --git a/gitbook/SUMMARY.md b/gitbook/SUMMARY.md index cb09529c..1dc3e5cd 100644 --- a/gitbook/SUMMARY.md +++ b/gitbook/SUMMARY.md @@ -45,6 +45,9 @@ * [oidc-token](oidc-token/oidc-token.md) * [General Usage](oidc-token/general.md) * [Detailed Information About All Options](oidc-token/options.md) + * [oidc-tokensh](oidc-token/oidc-tokensh.md) + * [General Usage](oidc-tokensh/general.md) + * [Detailed Information About All Options](oidc-tokensh/options.md) * [Other Applications Using oidc-agent](agent-clients.md) * [Tips](tips.md) * [oidc-agent-server](oidc-agent-server/oidc-agent-server.md) From 9519e4477a2a51aec42fc693399acd55f866f56f Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 23 Oct 2024 15:44:54 +0200 Subject: [PATCH 8/9] find appropriate packaging release --- .gitlab-ci-scripts/find-my-version.sh | 44 +++++++++++++++++++++++ .gitlab-ci-scripts/local-before-script.sh | 12 +++++-- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100755 .gitlab-ci-scripts/find-my-version.sh diff --git a/.gitlab-ci-scripts/find-my-version.sh b/.gitlab-ci-scripts/find-my-version.sh new file mode 100755 index 00000000..c44beeec --- /dev/null +++ b/.gitlab-ci-scripts/find-my-version.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +find_my_version() { + AVAILABLE_VERSIONS=$(git branch -vva \ + | grep packaging/v[0-9] \ + | awk '{ print $1 }' \ + | awk -F/ '{ print $4 }' \ + | sort -V \ + | grep -v ^$ \ + ) + LATEST_VERSION=$(git branch -vva \ + | grep packaging/v[0-9] \ + | awk '{ print $1 }' \ + | awk -F/ '{ print $4 }' \ + | sort -V \ + | tail -n 1 \ + ) + MY_VERSION="v$(cat VERSION)" + # MY_VERSION="v4.9.0" + # MY_VERSION="v5.0.0" + # MY_VERSION="v5.0.1" + + # echo "My version: ${MY_VERSION}" + # echo "Available: ${AVAILABLE_VERSIONS}" + # echo "Latest: ${LATEST_VERSION}" + + for VERSION in ${AVAILABLE_VERSIONS}; do + # echo "" + TESTVERSIONS="${VERSION} ${MY_VERSION}" + RESULTING_VERSION=$(for i in ${TESTVERSIONS}; do echo $i; done \ + | sort -V \ + | tail -n 1 \ + ) + # echo "Testing: ${VERSION} Result: ${RESULTING_VERSION}" + [[ "${RESULTING_VERSION}" == "${MY_VERSION}" ]] && { + VERSION_TO_USE=${VERSION} + # echo "Apparently: ${RESULTING_VERSION} == ${MY_VERSION}" + } + done + + # echo -e "\n" + # echo "VERSION_TO_USE: ${VERSION_TO_USE}" + echo "${VERSION_TO_USE}" +} diff --git a/.gitlab-ci-scripts/local-before-script.sh b/.gitlab-ci-scripts/local-before-script.sh index 8146f944..c9facd60 100755 --- a/.gitlab-ci-scripts/local-before-script.sh +++ b/.gitlab-ci-scripts/local-before-script.sh @@ -1,14 +1,22 @@ #!/bin/bash FILES="" +OIDC_AGENT_REPO="http://codebase.helmholtz.cloud/m-team/oidc/oidc-agent.git" PACKAGING_BRANCH="packaging" echo "======== oidc-agent-local-before-script starting=======" export VERSION=`cat VERSION` # clone the packages file of this repo: # Try with VERSION -echo "Trying to use branch for packaging: ${PACKAGING_BRANCH}/latest" -git clone -b ${PACKAGING_BRANCH}/latest http://codebase.helmholtz.cloud/m-team/oidc/oidc-agent.git delme || { + +MY_PACKAGING_VERSION="latest" +[ -e .gitlab-ci-scripts/find-my-version.sh ] && { + . .gitlab-ci-scripts/find-my-version.sh + MY_PACKAGING_VERSION=$(find_my_version) +} + +echo "Trying to use branch for packaging: ${PACKAGING_BRANCH}/${MY_PACKAGING_VERSION}" +git clone -b ${PACKAGING_BRANCH}/${MY_PACKAGING_VERSION} ${OIDC_AGENT_REPO} delme || { exit 10 } From 401867e615d3d96997c024fb1aa649b11cf751b7 Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 23 Oct 2024 16:08:56 +0200 Subject: [PATCH 9/9] retrigger ci --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c1d49b9..66791060 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -149,3 +149,4 @@ trigger-win-installer: +