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

RavenDB-21679 Require to assign AuthorizationStatus #18506

Merged
merged 2 commits into from May 23, 2024

Conversation

efratshenhar
Copy link
Contributor

@efratshenhar efratshenhar commented May 12, 2024

Issue link

https://issues.hibernatingrhinos.com/issue/RavenDB-21679

Additional description

We encountered a situation where the AuthorizationStatus was not assigned in the DatabaseSmugglerOptionsServerSide class.
Now, we ensure that it's assigned when creating a new instance.

Type of change

  • Bug fix
  • Regression bug fix
  • Optimization
  • New feature

How risky is the change?

  • Low
  • Moderate
  • High
  • Not relevant

Backward compatibility

  • Non breaking change
  • Ensured. Please explain how has it been implemented?
  • Breaking change
  • Not relevant

Is it platform specific issue?

  • Yes. Please list the affected platforms.
  • No

Documentation update

  • This change requires a documentation update. Please mark the issue on YouTrack using Documentation Required tag.
  • No documentation update is needed

Testing by Contributor

  • Tests have been added that prove the fix is effective or that the feature works
  • Internal classes added to the test class (e.g. entity or index definition classes) have the lowest possible access modifier (preferable private)
  • It has been verified by manual testing

Testing by RavenDB QA team

  • This change requires a special QA testing due to possible performance or resources usage implications (CPU, memory, IO). Please mark the issue on YouTrack using QA Required tag.
  • No special testing by RavenDB QA team is needed

Is there any existing behavior change of other features due to this change?

  • Yes. Please list the affected features/subsystems and provide appropriate explanation
  • No

UI work

  • It requires further work in the Studio. Please mark the issue on YouTrack using Studio Required tag.
  • No UI work is needed

src/Raven.Server/Documents/DatabaseRequestHandler.cs Outdated Show resolved Hide resolved
AuthenticateConnection = HttpContext.Features.Get<IHttpAuthenticationFeature>() as AuthenticateConnection;
}

public AuthorizationStatus GetAuthorizationStatus(string databaseName)
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member

Choose a reason for hiding this comment

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

Remove this and use it directly via RequestHandler.GetXYZ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

test/SlowTests/RavenDB-21679.cs Outdated Show resolved Hide resolved
test/SlowTests/RavenDB-21679.cs Show resolved Hide resolved
@arekpalinski arekpalinski requested a review from ppekrol May 13, 2024 12:52
@efratshenhar efratshenhar force-pushed the RavenDB-21679.fix branch 2 times, most recently from 21965dd to c2ab941 Compare May 15, 2024 20:19
@efratshenhar efratshenhar marked this pull request as ready for review May 16, 2024 05:35
protected AbstractDatabaseHandlerProcessor([NotNull] TRequestHandler requestHandler) : base(requestHandler)
{
ContextPool = requestHandler.ContextPool;
Logger = requestHandler.Logger;
AuthenticateConnection = HttpContext.Features.Get<IHttpAuthenticationFeature>() as AuthenticateConnection;
Copy link
Member

Choose a reason for hiding this comment

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

IIRC, this is not free (this is an IEnumerable) and you are now performing that for every single call to the database, even if this is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@arekpalinski
Copy link
Member

Please check failing tests - https://jenkins.hibernatingrhinos.com/job/PR_Tests/10867/

@arekpalinski arekpalinski merged commit 3befafb into ravendb:v6.0 May 23, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants