-
Notifications
You must be signed in to change notification settings - Fork 748
New command group: nextflow auth
#6380
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
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
e9b3f26 to
c01e56b
Compare
5e79a3b to
c5a3283
Compare
This comment was marked as resolved.
This comment was marked as resolved.
nextflow auth loginnextflow auth
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Let's start refactoring this as |
|
I get confused a bit on how -url is managed. I think it is better to simplify it by -url is for enterprise with PAT and no url is for cloud. Moreover, instead of hardcoding all environments, keep just the production values as default and allow to test in other environments using env variables. In fact, we already have the TOWER_API_ENDPOINT, we just would need to add the ones for auth endpoint and client id. What do you think about it? |
|
@jorgee I think that we still need the logic to detect the 3 prod / stage / dev URLs for cloud - it's needed to trigger the logic to try the Auth0 flow rather than just booting people to use a PAT. If we have that logic in the code, then I don't really see a reason to not also include the key and auth0 URL personally, it's only a handful of extra lines of code. And it'd be a swap for env vars. Given that I don't envision ever needing to test with any other auth0 URLs I'm not really sure it'd be any simpler..? |
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Set TOWER_ACCESS_TOKEN with new PAT. Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
pditommaso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i'm not wrong seqera_auth take over both TOWER_ACCESS_TOKEN and standard config level tower.accessToken, which is against usual config pattern in which local config override global config.
Considering this happens silently it can be very confusing.
|
@pditommaso I'm not sure I understand? This PR uses standard config, there's nothing bespoke here:
Nextflow then loads Example // Seqera Platform configuration
tower {
accessToken = 'eyJ........'
endpoint = 'https://api.cloud.stage-seqera.io'
enabled = true
workspaceId = '123456789012345' // org / workspace [Full name of workspace]
} |
|
I was missing this!
|
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Outdated
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Outdated
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Outdated
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Show resolved
Hide resolved
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Function does not expect tower. prefixes on config keys Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Simplify code around status table for finding auth value origins Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
|
@pditommaso thanks for the review - I believe that I have addressed all of your comments now. I have leaned heavily into using There are two exceptions to this:
Hope that makes sense and my edits are ok! 🙌🏻 |
pditommaso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few comments. it would also be nice reduce the number of colors (ma
plugins/nf-tower/src/main/io/seqera/tower/plugin/cli/AuthCommandImpl.groovy
Outdated
Show resolved
Hide resolved
modules/nextflow/src/main/groovy/nextflow/platform/PlatformHelper.groovy
Show resolved
Hide resolved
Not sure if you tested again after my changes, but I did make a start on toning the colours down a bit in 84c3584 already. Main thing is that on my terminal, I can do more to further reduce use of colour if you like. Note that |
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
modules/nextflow/src/main/groovy/nextflow/platform/PlatformHelper.groovy
Show resolved
Hide resolved
…per.groovy [ci skip] Co-authored-by: Phil Ewels <phil.ewels@seqera.io> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
|
ok, i'll check again the colours. Do you mind to change the base branch to a non-master for a last cleanup round? |
|
Changed the PR target to a new Saw you merged the |
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
This PR introduces a complete authentication system for Seqera Platform with multiple subcommands for managing authentication credentials and configuration.
CleanShot.2025-09-21.at.00.32.54.mp4
Features
New
nextflow authcommand with subcommands:nextflow auth login- Authenticate with Seqera Platform using OAuth2/PKCE flownextflow auth logout- Remove authentication credentials and clear configurationnextflow auth status- Show current authentication status and user informationnextflow auth config- Display current authentication configurationAuth0 Device Flow Authentication
Usage Examples
Technical Implementation
Core Components
Authentication Flow
Note
Introduces a new
nextflow authCLI with OAuth2 (Auth0) and PAT flows via nf-tower plugin, adds ANSI color utility, integrates into launcher, and includes comprehensive tests.CmdAuthcommand group with subcommands:login,logout,config,status.authintoLaunchercommand registry.ColorUtilfor ANSI-colored terminal output.io.seqera.tower.plugin.cli.AuthCommandImpl(extension ofCmdAuth.AuthCommand).nextflowVersionto25.08.0-edgeinplugins/nf-tower/build.gradle.CmdAuth,ColorUtil, andAuthCommandImpl.nextflow/trace/ReportObserver.groovy.Written by Cursor Bugbot for commit 00b4590. This will update automatically on new commits. Configure here.