Skip to content

Commit 745c7f2

Browse files
committed
⏪️ revert: remove SEQERA_ACCESS_TOKEN alias support
Revert addition of SEQERA_ACCESS_TOKEN as an alias for TOWER_ACCESS_TOKEN. The code now only supports TOWER_ACCESS_TOKEN as before. - Remove SEQERA_ACCESS_TOKEN priority logic from TowerClient.getAccessToken() - Remove SEQERA_ACCESS_TOKEN priority logic from PlatformHelper.getAccessToken() - Revert error messages to only mention TOWER_ACCESS_TOKEN - Remove updated docstrings mentioning SEQERA_ACCESS_TOKEN support
1 parent 1bc43ee commit 745c7f2

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

modules/nextflow/src/main/groovy/nextflow/platform/PlatformHelper.groovy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,16 @@ class PlatformHelper {
3030
/**
3131
* Return the configured Platform access token: if `TOWER_WORKFLOW_ID` is provided in the environment, it means
3232
* we are running in a Platform-made run and we should ONLY retrieve the token from the environment. Otherwise,
33-
* check the configuration or fallback to the environment. The access token can be provided via either
34-
* SEQERA_ACCESS_TOKEN (preferred) or TOWER_ACCESS_TOKEN environment variables. If no token is found, return null.
33+
* check the configuration or fallback to the environment. If no token is found, return null.
3534
*
3635
* @param opts the configuration options for Platform (e.g. `session.config.navigate('tower')`)
3736
* @param env the applicable environment variables
3837
* @return the Platform access token
3938
*/
4039
static String getAccessToken(Map opts, Map<String,String> env) {
4140
final token = env.get('TOWER_WORKFLOW_ID')
42-
? (env.get('SEQERA_ACCESS_TOKEN') ?: env.get('TOWER_ACCESS_TOKEN'))
43-
: opts.containsKey('accessToken') ? opts.accessToken as String : (env.get('SEQERA_ACCESS_TOKEN') ?: env.get('TOWER_ACCESS_TOKEN'))
41+
? env.get('TOWER_ACCESS_TOKEN')
42+
: opts.containsKey('accessToken') ? opts.accessToken as String : env.get('TOWER_ACCESS_TOKEN')
4443
return token
4544
}
4645

plugins/nf-tower/src/main/io/seqera/tower/plugin/TowerClient.groovy

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,15 @@ class TowerClient implements TraceObserver {
378378
log.info(LoggerHelper.STICKY, msg)
379379
}
380380

381-
/**
382-
* Get the access token for Seqera Platform authentication.
383-
* When 'TOWER_WORKFLOW_ID' is provided in the env, it's a tower made launch
384-
* therefore the access token should only be taken from the env.
385-
* Otherwise check into the config file and fallback in the env.
386-
* The access token can be provided via either SEQERA_ACCESS_TOKEN (preferred) or TOWER_ACCESS_TOKEN environment variables.
387-
*/
388381
String getAccessToken() {
382+
// when 'TOWER_WORKFLOW_ID' is provided in the env, it's a tower made launch
383+
// therefore the access token should only be taken from the env
384+
// otherwise check into the config file and fallback in the env
389385
def token = env.get('TOWER_WORKFLOW_ID')
390-
? (env.get('SEQERA_ACCESS_TOKEN') ?: env.get('TOWER_ACCESS_TOKEN'))
391-
: session.config.navigate('tower.accessToken', env.get('SEQERA_ACCESS_TOKEN') ?: env.get('TOWER_ACCESS_TOKEN'))
386+
? env.get('TOWER_ACCESS_TOKEN')
387+
: session.config.navigate('tower.accessToken', env.get('TOWER_ACCESS_TOKEN'))
392388
if( !token )
393-
throw new AbortOperationException("Missing Seqera Platform access token -- Make sure there's a variable SEQERA_ACCESS_TOKEN or TOWER_ACCESS_TOKEN in your environment")
389+
throw new AbortOperationException("Missing Seqera Platform access token -- Make sure there's a variable TOWER_ACCESS_TOKEN in your environment")
394390
return token
395391
}
396392

0 commit comments

Comments
 (0)