Skip to content

Add nextflow auth command for Seqera Platform authentication#6463

Merged
pditommaso merged 81 commits intomasterfrom
nextflow-auth
Oct 14, 2025
Merged

Add nextflow auth command for Seqera Platform authentication#6463
pditommaso merged 81 commits intomasterfrom
nextflow-auth

Conversation

@pditommaso
Copy link
Member

Summary

  • Adds new nextflow auth command group for simplified authentication with Seqera Platform
  • Implements auth login, auth logout, auth status, and auth config subcommands
  • Uses Auth0 device-flow authentication for secure token generation
  • Stores authentication credentials in ~/.nextflow/seqera-auth.config
  • Provides interactive CLI for workspace and compute environment configuration

Key Features

  • auth login: Interactive OAuth authentication flow with Auth0
  • auth logout: Removes stored authentication credentials
  • auth status: Displays current authentication status, workspace, and compute environment
  • auth config: Configure default workspace and primary compute environment

Implementation Details

  • Core command implementation in CmdAuth.groovy with delegation to AuthCommandImpl in nf-tower plugin
  • Uses PlatformHelper for consistent token and endpoint management
  • Colored CLI output with ColorUtil for better UX
  • Comprehensive test coverage with unit tests for both core and plugin implementations

Documentation

  • Updated docs/install.md with authentication instructions
  • Added detailed CLI reference in docs/reference/cli.md

Test plan

  • Unit tests for CmdAuth and ColorUtil
  • Comprehensive tests for AuthCommandImpl covering all auth flows
  • Manual testing of auth login/logout/status/config workflows
  • Verification of integration with existing Platform functionality

🤖 Generated with Claude Code

ewels and others added 30 commits September 29, 2025 13:40
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>
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>
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>
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>
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>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@ewels
Copy link
Member

ewels commented Oct 9, 2025

Should be good to go now @pditommaso

Copy link
Collaborator

@christopher-hakkaart christopher-hakkaart left a comment

Choose a reason for hiding this comment

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

Suggestions added

Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
ewels and others added 3 commits October 13, 2025 16:25
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
… tests [ci fast]

- Replace consecutive // comments with block /* */ style in CmdAuth and AuthCommandImpl
- Rename TOWER_AUTH_ID to TOWER_AUTH_CLIENT_ID in code and documentation
- Add comprehensive Spock tests for PlatformHelper.getAuthDomain() and getAuthClientId()
- Fix environment variable handling to check env vars before switch statement
- Add explanatory comments about env var precedence logic

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
Copy link
Member Author

pditommaso commented Oct 13, 2025

@ewels regarding the colours, don't know it's a problem with the screen, but I count at least 9 different colours

Screenshot 2025-10-13 at 21 51 24

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
Copy link
Member Author

@ewels fixed some tests, and removed some dead code. Please have a look at cb89f35

@ewels
Copy link
Member

ewels commented Oct 13, 2025

Ah you're my hero @pditommaso, I just sat down to try to figure out these failing tests.

I definitely remember writing this to fix the tests previously:

-        def result = cmd.getConfigValue(config, 'tower.accessToken', 'TOWER_ACCESS_TOKEN', null)
+        def result = cmd.getConfigValue(config, 'tower.accessToken', 'TOWER_ACCESS_TOKEN')

But I can't find it anywhere now so no idea where that commit went 😓 But never mind, as long as it works now! Thank you for fixing!

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@ewels
Copy link
Member

ewels commented Oct 13, 2025

@ewels regarding the colours, don't know it's a problem with the screen, but I count at least 9 different colours

Legend / explainer

1: No colour
2: magenta
3: No colour + dim
4: Green
5: Blue
6: Yellow
7: Yellow + bold
8: blue + dim
9: magenta + dim

So it's 4, following roughly this scheme (which I generally apply with colours in a non-strict way):

  • Magenta: file paths / URLs
  • Blue: variables / commands
  • Green: Success
  • Yellow: Warn

Then dim for "not important" and bold for "important".

Discussion

I think it looks more extreme with your colour scheme because your default colour (green) has such strong saturation, which makes the contrast between colours more extreme. With my terminal setup everything is a lot more muted / closer in colour:

CleanShot 2025-10-13 at 23 01 57@2x

But not everyone is using my terminal setup 😀 And I agree that it's a bit much. I'll strip some of this out where it's not adding much functionality 👍🏻

New commit about to be incoming to this PR..

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Copy link
Member Author

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

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

It looks a in good shape. Left a couple of minor comments

ewels added 3 commits October 13, 2025 23:47
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>
@ewels
Copy link
Member

ewels commented Oct 13, 2025

Ok, I removed a lot of the colour from the code:

CleanShot 2025-10-13 at 23 55 43@2x

I personally find it a bit harder to read now, but I know we're at opposite ends of the spectrum on this 😅 Hopefully this is an ok middle ground..?

Signed-off-by: Phil Ewels <phil.ewels@seqera.io>
@ewels
Copy link
Member

ewels commented Oct 14, 2025

Ok I think I managed to replicate your colour theme @pditommaso. This is how the colours should now look for you:

CleanShot 2025-10-14 at 08 50 18@2x

Reminder that NO_COLOR strips all colours, if that's better 😅

CleanShot 2025-10-14 at 08 51 04@2x

@pditommaso
Copy link
Member Author

Much better the colours now!

@pditommaso
Copy link
Member Author

Approved ✅

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

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

I approve this code!

@pditommaso pditommaso merged commit bedf02a into master Oct 14, 2025
29 checks passed
@pditommaso pditommaso deleted the nextflow-auth branch October 14, 2025 12:10
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.

5 participants