Skip to content

Add ability to present Managed Identity derived bearer token#96

Merged
steventux merged 3 commits intomainfrom
feat/acquire-managed-identity-token
Apr 27, 2026
Merged

Add ability to present Managed Identity derived bearer token#96
steventux merged 3 commits intomainfrom
feat/acquire-managed-identity-token

Conversation

@steventux
Copy link
Copy Markdown
Contributor

@steventux steventux commented Apr 15, 2026

Description

System assigned managed identity is provided on the gateway via Azure Arc.
We should use this to fetch the access token used in API communication. We can then validate on the Manage side.
Requires the presence of CLOUD_API_RESOURCE env var. This is an assumption based on azure sdk docs for ManagedIdentityCredential#get_token.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12648

Review notes

Review checklist

  • Check database queries are correctly scoped to current_provider

@steventux steventux force-pushed the feat/acquire-managed-identity-token branch from f1f6061 to 3e8c34a Compare April 15, 2026 12:05
Comment thread src/services/dicom/dicom_uploader.py Outdated

@property
def access_token(self) -> str:
resource = os.getenv("CLOUD_API_RESOURCE")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a case for differentiating between 'production' and 'development' environments, where a prod env unambiguously mandates the presence of CLOUD_API_RESOURCE

Copy link
Copy Markdown
Contributor

@carlosmartinez carlosmartinez left a comment

Choose a reason for hiding this comment

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

happy with this. at some point we should think about how a production-type environment differs from a non-production environment.

Copy link
Copy Markdown
Contributor

@carlosmartinez carlosmartinez left a comment

Choose a reason for hiding this comment

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

@steventux steventux force-pushed the feat/acquire-managed-identity-token branch 3 times, most recently from 056ddae to 2f6e1dd Compare April 27, 2026 09:48
@steventux steventux force-pushed the feat/acquire-managed-identity-token branch from 2f6e1dd to e1255a9 Compare April 27, 2026 10:49
@steventux steventux merged commit f633eb1 into main Apr 27, 2026
9 checks passed
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.

2 participants