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

Rewrite the sso code in Rust #335

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Rewrite the sso code in Rust #335

merged 1 commit into from
Jan 8, 2025

Conversation

dmulder
Copy link
Collaborator

@dmulder dmulder commented Jan 3, 2025

This rewrites the Python3 SSO code in Rust.

@dmulder
Copy link
Collaborator Author

dmulder commented Jan 3, 2025

This doesn't actually work yet. In testing, the Rust binary behaves exactly the same in the terminal, but the SSO browser plugin terminates the connection for some reason.

@dmulder dmulder changed the title Rewrite the sso code in Rust WIP: Rewrite the sso code in Rust Jan 3, 2025
@fmoessbauer
Copy link

This doesn't actually work yet. In testing, the Rust binary behaves exactly the same in the terminal, but the SSO browser plugin terminates the connection for some reason.

I'm pretty sure this is related to the line-format that is passed via stdin / stdout. The native messaging protocol is VERY picky about the data that is transferred.

@Urist-McGit
Copy link

This doesn't actually work yet. In testing, the Rust binary behaves exactly the same in the terminal, but the SSO browser plugin terminates the connection for some reason.

I have tested your implementation on my local machine in Firefox, and it worked fine for me. The native messages also match bit by bit as far as I have seen. Maybe some mistakes were made in your test setup?

Copy link

@Urist-McGit Urist-McGit left a comment

Choose a reason for hiding this comment

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

I also had a build failure, the new_v4 was not available from the uuid crate. I needed to enable the v4 feature for it.

src/sso/src/main.rs Outdated Show resolved Hide resolved
@dmulder
Copy link
Collaborator Author

dmulder commented Jan 7, 2025

I also had a build failure, the new_v4 was not available from the uuid crate. I needed to enable the v4 feature for it.

It's enabled by my Himmelblau workspace, which is why it worked for me. If you build it individually, it fails in this way.

@dmulder
Copy link
Collaborator Author

dmulder commented Jan 7, 2025

native messaging protocol

Perhaps I should be using a native messaging library, rather than re-inventing the wheel.

src/sso/src/main.rs Outdated Show resolved Hide resolved
Signed-off-by: David Mulder <[email protected]>
@dmulder
Copy link
Collaborator Author

dmulder commented Jan 8, 2025

native messaging protocol

Perhaps I should be using a native messaging library, rather than re-inventing the wheel.

I tried using this existing native messaging library, but it does not work. It sent the message wrapped in quotes, and the browser plugin couldn't parse it. I ended up getting my original implementation to work, so I'll stick with it.

@dmulder dmulder changed the title WIP: Rewrite the sso code in Rust Rewrite the sso code in Rust Jan 8, 2025
@dmulder dmulder merged commit e4dab02 into main Jan 8, 2025
5 checks passed
@dmulder dmulder deleted the dmulder/rust_sso branch January 8, 2025 16:35
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.

3 participants