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

feat(sessions): support custom session providers #383

Merged
merged 6 commits into from
Jun 9, 2024

Conversation

reubenmiller
Copy link
Owner

@reubenmiller reubenmiller commented Jun 2, 2024

Note This feature is not intended for users at the moment, but more for people are are interested in writing custom session providers etc.

Allow users to use custom session providers (e.g. read sessions from different password managers).

c8y sessions login --help

The new command, c8y sessions login, provides a mechanism to read session information from different sources:

  • stdin
  • file
  • env
  • external command

This should allow users to write custom providers which feed the c8y sessions login command with the initial credentials, and then the command will take care of the authentication checks and/or login using tokens etc.

Examples

bitwarden

bitwarden session provider: https://github.com/reubenmiller/c8y-session-bitwarden

set-session-bitwarden() {
    eval "$(c8y sessions login --from-cmd "c8y-session-bitwarden list --folder c8y" --shell auto)"
}

set-session-bitwarden

@reubenmiller reubenmiller marked this pull request as ready for review June 8, 2024 19:04
@reubenmiller reubenmiller merged commit 61231c2 into v2 Jun 9, 2024
4 checks passed
@reubenmiller reubenmiller deleted the feat-session-providers branch June 9, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant