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

Support external authentication #390

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

stertingen
Copy link

@stertingen stertingen commented Jan 27, 2021

  • Introduce Authentication base class
  • Make Connection and TcpConnection classes use new Authentication class
  • Add EXTERNAL Authentication class

This PR aims to replace #93

@stertingen stertingen marked this pull request as draft January 27, 2021 14:39
@stertingen stertingen changed the title WIP: Support external authentication Support external authentication Jan 27, 2021
@stertingen stertingen marked this pull request as ready for review January 27, 2021 16:52
@stertingen
Copy link
Author

@EmielBruijntjes Would you please take a look at this?

@stertingen
Copy link
Author

If desired I could change the PR to use less std::shared_ptr. The conntection object would then store authentication mechanism and response instead of a shared pointer to the authentication object. More simple but maybe less flexible.

@EmielBruijntjes
Copy link
Member

I indeed do not like the shared-pointer mechanism, especially not that it is exposed to "user space", that implementation-specific detail (that it uses a shared pointer) should be encapsulated inside AMQP-CPP.

@stertingen
Copy link
Author

I indeed do not like the shared-pointer mechanism, especially not that it is exposed to "user space", that implementation-specific detail (that it uses a shared pointer) should be encapsulated inside AMQP-CPP.

Okay, the PR is updated to use no std::shared_ptr.

@plopp
Copy link

plopp commented Mar 29, 2021

It seems this is failing in ci because of docker pull rate limiting? @EmielBruijntjes

anyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.
See 'docker run --help'.
The command "docker run -e "DEBIAN_FRONTEND=noninteractive" -d --name ubuntu-test-container -v $(pwd):/travis ubuntu:focal tail -f /dev/null" failed and exited with 125 during .

@plopp
Copy link

plopp commented Mar 31, 2021

@stertingen would you mind retriggering the CI?

@stertingen
Copy link
Author

@stertingen would you mind retriggering the CI?

How would I do this?

@plopp
Copy link

plopp commented Apr 5, 2021

@stertingen would you mind retriggering the CI?

How would I do this?

CI might have to be manually triggered by the repo owners. If it is not it might suffice to close the PR and reopening it.

The reason I want you to try to get CI to rerun is I think the build failed because of rate limiting on the docker hub. Nothing to do with your change, because your code looks fine.

As long as it does not build properly it won't get traction for a merge. Thanks!

@stertingen stertingen closed this Apr 5, 2021
@stertingen stertingen reopened this Apr 5, 2021
@plopp
Copy link

plopp commented Apr 6, 2021

Great @stertingen! Let's hope @EmielBruijntjes can decide on a "go or no-go" now that it passes the checks!

@trevorperrin
Copy link
Contributor

One issue I see with this change is that Address already includes an Authentication object (Login), which means that two authentication objects are created when creating a TcpConnection.

AMQP::Login myLogin("", "");
AMQP::Address address(host, port, myLogin, vhost, true);
AMQP::TcpConnection connection(&myHandler, address, AMQP::ExternalAuth());

Could Address be modified to use Authentication instead, in which case perhaps TcpConnection doesn't need the third parameter?

This is one reason why my initial inclination was to modify Login to provide external authentication like pull request #93, and my pull request #458 (which is an alternate but very similar approach). Either way works, it's a question of which is more desirable

@EmielBruijntjes
Copy link
Member

I agree with @trevorperrin. The structure of the code and how the Address, Login and Authentication classes interact needs a bit more attention.

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.

4 participants