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

Removing SWT authentication handler #10654

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Removing SWT authentication handler #10654

wants to merge 1 commit into from

Conversation

mathewc
Copy link
Member

@mathewc mathewc commented Nov 25, 2024

Earlier in the year, I had already deactivated the SWT authentication handler (in this PR). Those changes have been fully released.

In this PR I'm just cleaning this dead code up now - removing the auth handler and supporting code. This handles incoming SWTs (no longer supported). I'll handle outbound SWTs in an upcoming PR. There are only 2 outbound calls SWTs are included on, and those can be controlled via hosting config. So for that, we'll do hosting config testing first, then follow up with code removal.

I will be backporting this to the in-proc branch, but no further.

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • TODO
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

@mathewc mathewc requested a review from a team as a code owner November 25, 2024 23:31
private AuthenticateResult HandleAuthenticate()
{
string token = null;
if (!_hostingConfigOptions.Value.SwtAuthenticationEnabled || !Context.Request.Headers.TryGetValue(ScriptConstants.SiteRestrictedTokenHeaderName, out StringValues values))
Copy link
Member Author

@mathewc mathewc Nov 25, 2024

Choose a reason for hiding this comment

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

As you can see, this handler was already deactivated anyways because the default for the SwtAuthenticationEnabled hosting config was False, and no stamps are currently configured to override this with True. So it's safe to remove all this code.

response = await _fixture.Host.HttpClient.SendAsync(request);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}

[Fact]
public async Task HostAdminApis_IgnoresSwtTokenWhenDisabled()
public async Task HostAdminApis_IgnoresSwtTokens()
Copy link
Member Author

Choose a reason for hiding this comment

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

Retaining this negative test for now. I'll remove it when I remove the remaining SWT support (outgoing).

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