The GVM Authentication Library is a Rust library for common authentication functionality used within the Greenbone Vulnerability Manager such as the generation of JSON Web Tokens and communicating with authentication APIs like OAuth and OpenID Connect.
The library is mostly implemented in Rust but a wrapper for use in C is also included. The components are organized as a Rust workspace consisting of multiple crates.
The gvm-auth crate is the main library for use in Rust.
It can be built with the standard Cargo command
cargo build -p gvm-auth
The gvm-auth-c crate is a wrapper of the library for use in C.
It can be built with the standard Cargo command
cargo build -p gvm-auth-c
In case of build-time errors, it can be useful to exclude the C header file generation as cargo and rustc often give more helpful error messages than cbindgen.
To do this, you can disable the default features when building the crate:
cargo build -p gvm-auth-c --no-default-features
To automatically install the C library or build the Cgreen tests, first create a build directory and initialize the CMake project inside with the same installation prefix as gvm-libs and other GVM modules like gvmd.
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=~/my-gvm-prefix ..
If the prefix is set up correctly, you should be able to install the library, header file and pkgconfig file with the standard make target:
make install
It can then be added as a dependency to other CMake projects as
libgvm_auth:
pkg_check_modules(LIBGVM_AUTH REQUIRED libgvm_auth>=0.1.0)
Inside the build directory you can build the tests with the make target tests
and then run them with the test target:
make tests
make test
The gvm-auth-cli crate is a command line tool for testing various functions
of the GVM authentication libary gvm-auth-lib.
It can be built with the standard Cargo command
cargo build -p gvm-auth-cli
