DataBiosphere / terra-notebook-utils

Utilities for the Terra notebook environment.
MIT License
7 stars 6 forks source link

Enable TNU to use Azure auth for DRS operations #399

Closed mbaumann-broad closed 1 year ago

mbaumann-broad commented 1 year ago

Objective

Support TNU DRS operations when TNU is running in a Terra Azure IA Cloud Environment.
When running in a Terra Azure IA Cloud Environment, TNU must get/use an Azure access token (via the DefaultAzureCredential) when communicating with Terra backend services (i.e., martha/terra-drs-hub, rawls).
Support for all TNU operations when running on GCS must continue to work as it has.

Scope

Background

Terra backend services now accept three types of bearer tokens:

The proposed algorithm to successfully obtain an appropriate access token for use with Terra backend services is:

  1. Identify the context in which TNU is running. Proposed values include:
    • Terra Azure
    • Terra GCS
    • Unknown (some other context, such as on a local system)
      1. Get an access token based on the execution context 2.1. if the execution context is Terra Azure, get an Azure access token. 2.2. if the execution context is Terra GCS, get a Google access token (as before). 2.3. if the execution context is unknown, try getting a GCS access token, if that fails try getting an Azure token, if that fails, then exit with an error.

Acceptance Criteria