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

Rust migration PoC #35

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

Rust migration PoC #35

wants to merge 11 commits into from

Conversation

gboutry
Copy link
Contributor

@gboutry gboutry commented Feb 22, 2022

This PR is PoC showing what a rust migration could look like.

There should be no change to the interface.

What's new in this PR:

  • feat: remove cpp
  • feat: add rust implementation
  • fix: use asynctask instead of embedding tokio runtime
  • fix: windows build
  • fix: macos build
  • feat: add local testing
  • feat: install_krb5.sh vendors a krb5 version
  • fix: docker test, add ubuntu-vendored target
  • fix: use parameter destructuration

Requirements change

  • Rust
  • LLVM
  • pkg-config

The dependencies change, node-gyp is no longer required for the build, such as python (but python is still needed for src/server.py

How to build

In any case, the build command is: npm install, but os and installation method may vary:

  • Linux with system-wide krb5 libs:
    • Nothing much to do, it should work out of the box
  • With custom prefix:
    • Linux: Either declare the variable export KRB5_HOME=/path/to/your/prefix or export PKG_CONFIG_PATH=/path/to/your/krb5/pkg-config
    • MacOs: Either declare the variableexport KRB5_HOME=/path/to/your/homebrew/cellar/krb5 (this is a custom prefix) or export PKG_CONFIG_PATH=/path/to/your/homebrew/cellar/krb5/lib/pkg-config
  • With Windows:
    • If you installed with MIT Kerberos 4.1, it should work out of the box, in any case you can set the variable $env:KRB5_HOME=X:\path\to\you\mit\kerberos\installation

New

  • The script install_krb5.sh now installs MIT Kerberos into a folder vendor at the root of the project. If you want to build the project with this version, simply set the variable export KRB5_HOME=${project_path}/vendor.
  • It is now possible to run the tests locally on Linux and MacOs, by running npm run local_test, it will instantiate a KDC, a Kadmind and a server.py on your host, without docker. You must have the krb5 sbin binaries in your path. If you don't overwrite your PATH variables and you don't have system-wide binaries, you can set the variable export KRB5_HOME=/path/to/your/krb5/prefix
  • A new Docker target has been added: ubuntu-vendored, it's the same as ubuntu but instead of getting krb5 from apt, it's using the install_krb5.sh script

Breaking Change

  • Since Rust does not support z/OS, if work is to be continued on this pull request, z/OS support must be dropped from this library.

This PR has been tested on Ubuntu 20.04, MacOs 11 Big Sur, Windows 10 20H2, and with the containers.
All tests have been performed on a x86_64 processor, would be interested with feedback on ARM (macos).

Copy link

@PaulFarault PaulFarault left a comment

Choose a reason for hiding this comment

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

LGTM

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