-
Notifications
You must be signed in to change notification settings - Fork 0
Add custom authenticator support #39
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
Conversation
src/catalog.jl
Outdated
| # Step 3: Create the C callback function that wraps the Julia authenticator | ||
| c_callback = @cfunction( | ||
| $( | ||
| function token_callback(user_data::Ptr{Cvoid}, token_ptr::Ptr{Ptr{Cchar}})::Cint |
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.
Doesn't this have to be marked with Base.@ccallable?
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.
Went with Option 1 above
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.
Shouldn't we still mark this as ccallable? I'm not sure I understand Julia here, but in other places we do mark callbacks like that.
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.
The function itself (token_callback_impl) is ccallable
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.
It's not, but appears this is not needed for callbacks passed as @cfunction, only when C/Rust initiates communication with Julia code.
| headers=["Authorization" => auth_header, "Polaris-Realm" => realm, "Content-Type" => "application/x-www-form-urlencoded"], | ||
| headers=[ | ||
| "Authorization" => auth_header, | ||
| "Polaris-Realm" => realm, |
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.
not for this change, but I think this realm might not work for Horizon catalog etc. Are we exposing configuring it through RustyIceberg? And then through raicode...
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.
Not really exposing anything specific, as these are just general properties via a string map
Co-authored-by: Vukasin Stefanovic <vukasin.stefanovic92@gmail.com>
…yIceberg.jl into feature/gb/custom-auth
This reverts commit 3b14cb7.
| /// Set a custom token authenticator before catalog creation | ||
| pub fn set_token_authenticator( | ||
| &mut self, | ||
| callback: CustomAuthenticatorCallback, |
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.
Should we construct FFITokenAuthenticator outside of set_token_authenticator and then just set it here?
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.
FFITokenAuthenticator is rather internal (caching stuff, etc.). So I'd leave that be
vustef
left a comment
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.
Thanks Gerald!
Relates to RAI-45581