gvm-auth-cli 0.2.0

Basic CLI tools using gvm-auth-lib
![Greenbone Logo](https://www.greenbone.net/wp-content/uploads/gb_new-logo_horizontal_rgb_small.png)

# GVM Authentication Library (gvm-auth-lib) <!-- omit in toc -->

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.

## Main Rust library (gvm-auth)

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
```

## C wrapper library (gvm-auth-c)

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
```

### Preparing the installation and tests

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 ..
```

### Installation

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)
```

### Cgreen tests

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
```

## CLI tools (gvm-auth-cli)

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
```