Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.2.3 #608

Merged
merged 10 commits into from
Oct 24, 2024
Merged

5.2.3 #608

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .gitlab-ci-scripts/find-my-version.sh
Original file line number Diff line number Diff line change
@@ -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}"
}
12 changes: 10 additions & 2 deletions .gitlab-ci-scripts/local-before-script.sh
Original file line number Diff line number Diff line change
@@ -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
}

Expand Down
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,4 @@ trigger-win-installer:




11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
<!-- ### Dependencies -->
<!-- -->

## 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
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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!"

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.2.2
5.2.3
3 changes: 3 additions & 0 deletions gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 26 additions & 1 deletion gitbook/installation/windows.md
Original file line number Diff line number Diff line change
@@ -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 <shortname>

# From Powershell
wsl oidc-token <shortname>
```

### "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.
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.
5 changes: 0 additions & 5 deletions lgtm.yml

This file was deleted.

17 changes: 17 additions & 0 deletions src/h2m/oidc-tokensh.h2m
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/ipc/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/oidc-tokensh/oidc-tokensh
Original file line number Diff line number Diff line change
Expand Up @@ -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 $*"
Expand Down
Loading