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
example snippet for akka http java dsl: SecurityDirectives #20717
example snippet for akka http java dsl: SecurityDirectives #20717
Conversation
Can one of the repo owners verify this patch? |
OK TO TEST |
Test FAILed. |
@@ -72,6 +73,11 @@ | |||
Self addHeaders(Iterable<HttpHeader> headers); | |||
|
|||
/** | |||
* Returns a copy of this message with the given http credential header added to the list of headers. | |||
*/ | |||
Self addCredentials(HttpCredentials credentials); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good addition 👍
Since no-one else but us may extend HttpMessage
we are allowed to add the mima filters to make this pass.
Failure of build was:
[info] akka-http-core: found 2 potential binary incompatibilities while checking against com.typesafe.akka:akka-http-core_2.11:2.4.2 (filtered 122)
[error] * abstract method addCredentials(akka.http.javadsl.model.headers.HttpCredentials)java.lang.Object in interface akka.http.javadsl.model.HttpMessage#MessageTransformations is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.javadsl.model.HttpMessage#MessageTransformations.addCredentials")
[error] * method addCredentials(akka.http.javadsl.model.headers.HttpCredentials)akka.http.scaladsl.model.HttpMessage in trait akka.http.scaladsl.model.HttpMessage is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.model.HttpMessage.addCredentials")
And yeah, we can add those filters, so please do so in MiMa.scala :)
Thanks a lot in advance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have fixed it and verified with mimaReportBinaryIssues
, correct me if there exists something wrong in my code, thanks!
fcc5acb
to
ca12572
Compare
Test PASSed. |
LGTM |
// check if user is authorized to perform admin actions, | ||
// this could potentially be a long operation so it would return a Future | ||
final Set<String> admins = new HashSet<>(); | ||
admins.add("Peter"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is mutable it is not safe to access it inside of the completable future, needs to be immutable, or a threadsafe set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will fix it now.
LGTM except for the mutable user set part |
ca12572
to
11f0d1a
Compare
@johanandren updated according to your comment. |
Great, thanks! |
Test PASSed. |
LGTM however does not merge (needs a rebase), would you be able to rebase this PR so we can merge @Hawstein ? |
@ktoso absolutely! |
11f0d1a
to
223d994
Compare
@ktoso Have rebased the PR. |
Test PASSed. |
Thanks a lot! Sorry you had to rebase:) |
Ref #20466