-
Notifications
You must be signed in to change notification settings - Fork 8
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 login with role_id and secret_id #303
base: main
Are you sure you want to change the base?
Support login with role_id and secret_id #303
Conversation
Thanks! I just approved the new build, but I think we're still going to get binary compatibility exceptions. This library has a stable API, so we need to be careful about breaking changes. There are a couple things we can do here:
|
Oh, the build passed because of the MiMa exceptions. Yeah, we're going to need to find a way to make this pass without those. Does that otel4s example make sense how the pattern might be applied here? I can give more detail if it doesn't. |
Thanks for the feedback! |
Sorry, got distracted, but tagging myself so I can look at again tomorrow when I'm fresh. |
@rossabaker a gentle reminder on this. |
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.
Sorry it took me so long to get back to this.
We still have those MiMa exceptions that we need to get rid of. I wonder if we could make the old signatures private, and delegate to your new implementations.
This looks mostly correct, but a couple comments on the builder pattern.
def apply(roleId: String)(implicit F: Concurrent[F]): F[VaultToken] | ||
} | ||
|
||
final case class VaultLoginOperationImpl[F[_]](client: Client[F], vaultUri: Uri, roleSecretId: Option[String] = None) extends VaultLoginOperation[F] { |
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.
When this is a case class, we can't add new parameters later in a bincompat fashion, so this isn't quite the builder pattern. Making it an abstract class with a private constructor should work. You'll need to implement your own copy
then. I also don't think this needs to be public.
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.
@rossabaker thanks you for getting back to this
May I kindly ask you to provide some examples of similar implementations with "abstract class with a private constructor"?
I tried to get back to the examples that you provided before to get some insights, but it looks like the project was refactored and now it uses case class.
def apply(roleId: String, tokenLeaseExtension: FiniteDuration)(implicit A: Async[F]): Stream[F, String] | ||
} | ||
|
||
final case class VaultLoginAndKeepOperationImpl[F[_]](client: Client[F], vaultUri: Uri, roleSecretId: Option[String] = None) extends VaultLoginAndKeepOperation[F] { |
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.
Same comments as VaultLoginOperationImpl.
Hello! I'm looking into this feature, I'd be willing to finish this MR if we can agree this is the implementation that should be targeted :) |
Good luck @Koroeskohr ! |
Add role secret_id support to login.
Fixes #302