Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bootstrap reload in offline mode. #595

Merged
merged 2 commits into from
Dec 6, 2024
Merged

fix: bootstrap reload in offline mode. #595

merged 2 commits into from
Dec 6, 2024

Conversation

chriswk
Copy link
Member

@chriswk chriswk commented Dec 6, 2024

After adding support for client and frontend tokens, we did not extend the reloader to check client and frontend token Vecs, this PR extends tokens with FE and Client tokens, to ensure that we refresh the data for all our tokens.

In addition we make /internal-backstage/tokens useful for offline mode as well, to at least be able to see which tokens you added to Edge.

In addition, since offline mode did not set up a token validator, I extended the auth middleware to check if our offline token has a token type set and if they do, limit their access to what they were intended for (client for /api/client, frontend for /api/frontend | /api/proxy)

Fixes: #594

After adding support for client and frontend tokens, we did not extend
the reloader to check client and frontend token Vecs, this PR extends
tokens with FE and Client tokens, to ensure that we refresh the data for
all our tokens.

In addition we make /internal-backstage/tokens useful for offline mode
as well, to at least be able to see which tokens you added to Edge.

Fixes: #594
@chriswk chriswk self-assigned this Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@chriswk chriswk requested a review from daveleek December 6, 2024 10:33
srv.call(req).await?.map_into_left_body()
} else {
req.into_response(HttpResponse::Forbidden().finish())
.map_into_right_body()
}
}
Some(TokenType::Client) => {
trace!("Got Client token validated {:?}", known_token);
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why we're getting rid of these now?

Copy link
Member Author

Choose a reason for hiding this comment

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

We've verified that it triggers, and we have the /internal-backstage/tokens endpoint to see which tokens we know about, so cleaned it up.

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LGTM

@chriswk chriswk merged commit 0dac00e into main Dec 6, 2024
9 checks passed
@chriswk chriswk deleted the fix/bootstrapReload branch December 6, 2024 12:43
@DAGRSAG
Copy link

DAGRSAG commented Dec 6, 2024

@chriswk Thanks for fixing both things. The question is, when is a new release with the fix available? Do you have an information for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Reload not working with unleash edge in offline mode
3 participants