Skip to content

fix: Skip azure authentication on /api resources#2702

Open
hannesg wants to merge 1 commit intomainfrom
fix-api-azure-auth-foo
Open

fix: Skip azure authentication on /api resources#2702
hannesg wants to merge 1 commit intomainfrom
fix-api-azure-auth-foo

Conversation

@hannesg
Copy link
Copy Markdown
Member

@hannesg hannesg commented Jan 13, 2026

There are basically two api endpoints at the moment. The old one on /environment and /environment-group and the newer one on /api/environment and /api/environment-group. For the old one, the azure authentication is explictly skipped in favour of gpg message signing but the new endpoints don't have that feature. Therefore, the new endpoints are basically unusable from our build server when azure auth is enabled.

@hannesg hannesg requested a review from a team as a code owner January 13, 2026 09:54
if envName != "" { // We shouldn't receive an empty env, added just as a second layer of validation
function, tail := xpath.Shift(tail)
switch function {
case "lock", "releasetrain", "applications", "cluster":
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"applications" and "cluster" are not returning true for the non-api case, it seems. Why should they for /api-API?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The cluster endpoint simply does not exist for the old api. The applications endpoint does exist, but I can't tell you if it's needed because we are not using it.

case "lock", "releasetrain", "applications", "cluster":
return true
case "": // create environment
if tail == "/" && (requestMethod == http.MethodPost || requestMethod == http.MethodDelete) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MethodDelete is not returning true for the non-api case, it seems. Why should it for /api-API?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I also stubled about this. My best idea is that this simply a bug that we haven't found yet because we rarely delete environments.

}

// Skip azure authentication with ID for `/` (POST: createEnv), `/release`, `/releasetrain` and `/locks` endpoints. The requests will be validated with pgp signature
// Also requests to the `/api` endpoints do the same.
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.

instead of adding this feature to /api, we should add the required endpoint to the old api.
The new /api is essentially our migration path to get away from "azureauth".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not picky. I just need one way to access it.

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.

3 participants