Skip to content

Add pelican credentials token setup command for standalone credential file creation#3143

Open
Copilot wants to merge 1 commit intomainfrom
copilot/add-credential-file-creation
Open

Add pelican credentials token setup command for standalone credential file creation#3143
Copilot wants to merge 1 commit intomainfrom
copilot/add-credential-file-creation

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Extracts credential file creation from the rclone PR (#3085) into a standalone CLI command that acquires OAuth2 tokens and persists them (with refresh token and client credentials) to disk.

New CLI command

pelican credentials token setup <pelican-url>
pelican credentials token setup --no-password --write pelican://federation.example.org/namespace/path
pelican credentials token setup --credential-file /path/to/creds.pem --read pelican://federation.example.org/namespace/path

Flags: --read/--write (scope), --no-password (skip encryption), --credential-file (custom output path).

Changes

  • docs/parameters.yaml — New Client.CredentialFile parameter to override default credential file path
  • param/ — Regenerated via go generate to expose Client_CredentialFile
  • config/encrypted.go
    • GetEncryptedConfigName() respects Client.CredentialFile override
    • SaveConfigContentsToFile(config, path, withPassword) — writes credentials to a specific path, optionally unencrypted
    • HasEncryptedPassword() — checks if credential file uses password-protected PEM
  • cmd/credentials_token_setup.go — New setup subcommand wired into credentials token
  • cmd/config_mgr.go — Wire setup into the existing credentials token command tree
  • config/credential_file_test.go — Tests for SaveConfigContentsToFile, HasEncryptedPassword, and GetEncryptedConfigName override including a roundtrip test

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • abc123
    • Triggering command: /tmp/go-build3488651583/b001/config.test /tmp/go-build3488651583/b001/config.test -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.count=1 sdk-for-go/sdk/a-Wl,--export-dynamic-symbol=main om/pressly/goose/tmp/go-link-1142583669/trivial.c rg/toolchain@v0.0.1-go1.25.0.lin-importcfg --gdwarf-5 p mpile rg/toolchain@v0.-buildtags knNv�� @v1.3.2/protoc-g-errorsas @v1.3.2/protoc-g-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet abis o/sdk/internal/e-unsafeptr=false --64 ux-amd64/pkg/too/tmp/go-build1551708337/b359/vet.cfg (dns block)
    • Triggering command: /tmp/go-build1296534582/b001/config.test /tmp/go-build1296534582/b001/config.test -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.count=1 1.67.3/internal/-errorsas om/dlclark/regex-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 l/linux_amd64/co-o ux-amd64/pkg/too/tmp/ccfr49sc.o -I g_.a om/aws/aws-sdk-go@v1.45.25/aws/endpoints/defaultgithub.com/GehirnInc/crypt/common rg/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile --gdwarf-5 channelz mpile rg/toolchain@v0.-o (dns block)
  • cilogon.org
    • Triggering command: /tmp/go-build3488651583/b001/config.test /tmp/go-build3488651583/b001/config.test -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.count=1 sdk-for-go/sdk/a-Wl,--export-dynamic-symbol=main om/pressly/goose/tmp/go-link-1142583669/trivial.c rg/toolchain@v0.0.1-go1.25.0.lin-importcfg --gdwarf-5 p mpile rg/toolchain@v0.-buildtags knNv�� @v1.3.2/protoc-g-errorsas @v1.3.2/protoc-g-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet abis o/sdk/internal/e-unsafeptr=false --64 ux-amd64/pkg/too/tmp/go-build1551708337/b359/vet.cfg (dns block)
    • Triggering command: /tmp/go-build1296534582/b001/config.test /tmp/go-build1296534582/b001/config.test -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.count=1 1.67.3/internal/-errorsas om/dlclark/regex-ifaceassert ux-amd64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 l/linux_amd64/co-o ux-amd64/pkg/too/tmp/ccfr49sc.o -I g_.a om/aws/aws-sdk-go@v1.45.25/aws/endpoints/defaultgithub.com/GehirnInc/crypt/common rg/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile --gdwarf-5 channelz mpile rg/toolchain@v0.-o (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Standalone client credential file creation</issue_title>
<issue_description>One side-quest in https://github.com/PelicanPlatform/pelican/pull/3085/changes was adding the ability in the client to create an unencrypted credential file (containing a refresh token and an OIDC client credential) and the ability to hand a credential file to the pelican client as a command line flag.

Let's extract just that code (which will help make the rclone PR smaller) and make some of it accessible via the CLI. Let's call the CLI:

pelican credentials token setup

and, instead of the functionality in pelican credentials token get or pelican token fetch that print out a single access token, it saves a credential file to disk containing the token and refresh token / credentials that we can use elsewhere. Have a --no-password flag that allows the user to skip password-protecting the file.

The Client_CredentialFile pieces from the rclone PR can be brought over relatively unscathed.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add standalone client credential file creation feature Add pelican credentials token setup command for standalone credential file creation Feb 18, 2026
Copilot AI requested a review from bbockelm February 18, 2026 17:01
Copy link
Collaborator

@bbockelm bbockelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase the branch to a single commit so I can more easily cherry-pick.

Copy link
Contributor Author

Copilot AI commented Feb 18, 2026

Please rebase the branch to a single commit so I can more easily cherry-pick.

I'm unable to squash commits because git rebase requires force push, which isn't available in my environment. The "Initial plan" commit (bc027bd) is an empty commit with no file changes — all actual code is in e67a5e7. Could you squash the commits when cherry-picking, or I can recreate the branch if you prefer?

Copilot AI requested a review from bbockelm February 18, 2026 19:30
@bbockelm bbockelm added enhancement New feature or request client Issue affecting the OSDF client labels Feb 21, 2026
@bbockelm bbockelm force-pushed the copilot/add-credential-file-creation branch from e67a5e7 to 9853e44 Compare February 21, 2026 16:40
@bbockelm bbockelm marked this pull request as ready for review February 21, 2026 16:41
- Add Client.CredentialFile parameter to docs/parameters.yaml
- Regenerate param files with new Client_CredentialFile parameter
- Add Client_CredentialFile override in GetEncryptedConfigName()
- Add SaveConfigContentsToFile() for saving credentials to specific paths
- Add HasEncryptedPassword() to check if credential file is password-protected
- Create credentials_token_setup.go with the setup subcommand
- Add --no-password, --credential-file, --read, --write flags
- Add tests for new functionality

Co-authored-by: bbockelm <1093447+bbockelm@users.noreply.github.com>
@bbockelm bbockelm force-pushed the copilot/add-credential-file-creation branch from 9853e44 to e9bdd8c Compare February 21, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Issue affecting the OSDF client enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standalone client credential file creation

2 participants