diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e5535652308402f0ee00a9b4b45ed311c99f58f..eb23a017b66c2e086ad82402a7506171f2d41288 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ build: - apt-get -y install libjq-dev libonig-dev libpam0g-dev script: - cargo build --release - - strip target/release/libnss_pam_oidc.so + - strip target/release/libnss_pam_webapi.so artifacts: paths: - - target/release/libnss_pam_oidc.so + - target/release/libnss_pam_webapi.so diff --git a/Cargo.toml b/Cargo.toml index d651218d033215f213724d302e3ea6c888758ec2..546e8acf93c7f480cfd822f9467858e41336fa17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "nss_pam_oidc" +name = "nss_pam_webapi" version = "0.1.0" authors = ["Dominik George <dominik.george@teckids.org>"] edition = "2018" -description = "NSS/PAM modules for OpenID Connect/OAuth2" -repository = "https://edugit.org/lanki.cloud/glue/nss-pam-oidc" +description = "NSS/PAM modules for use with Web APIs (OAuth 2.0, REST)" +repository = "https://edugit.org/lanki.cloud/glue/nss-pam-webapi" license = "Apache-2.0" categories = ["authentication", "os", "os::linux-apis"] [lib] -name = "nss_pam_oidc" +name = "nss_pam_webapi" crate-type = [ "cdylib" ] [dependencies] diff --git a/README.md b/README.md index c1a6218c2051c4483ca609504a264831cf0171da..53c62b633176c4724c5adc7ab2178a9c004b9144 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# NSS/PAM modules for OpenID Connect/OAuth2 +# NSS/PAM modules for use with Web APIs (OAuth 2.0, REST) -`nss-pam-oidc` is a multi-purpose shared library that links Linux +`nss-pam-webapi` is a multi-purpose shared library that links Linux system authentication (PAM) and name resolution for users and groups (NSS) to an OAuth2 API. It is "multi-purpose" because it builds a single shared object file exposing both the APIs of PAM and NSS. It can be used: - * in `/lib/security/pam_oidc.so` as PAM module - * in `/lib/libnss_oidc.so` as NSS database module - * in `/sbin/nss_pam_oidc_cached` as caching daemon to speed up requests + * in `/lib/security/pam_webapi.so` as PAM module + * in `/lib/libnss_webapi.so` as NSS database module + * in `/sbin/nss_pam_webapi_cached` as caching daemon to speed up requests ## System authentication (PAM module) @@ -100,7 +100,7 @@ It can only be used if the OAuth server used supports refresh tokens so will break name resolution once the access token expires until the user logs in anew). -## Caching daemon (`nss_pam_oidc_cached`) +## Caching daemon (`nss_pam_webapi_cached`) The caching daemon is a system service that periodically keeps data from the API up to date. It handles the following data: diff --git a/etc/nss_pam_oidc.example.toml b/etc/nss_pam_webapi.example.toml similarity index 89% rename from etc/nss_pam_oidc.example.toml rename to etc/nss_pam_webapi.example.toml index 71ce03735d0e0ab9771da740c92365098410df8a..a48444fe90b60932d9dcfc3a8e4b1d082291b67d 100644 --- a/etc/nss_pam_oidc.example.toml +++ b/etc/nss_pam_webapi.example.toml @@ -3,12 +3,12 @@ auth_url = "https://ticdesk-dev.teckids.org/oauth/authorize/" token_url = "https://ticdesk-dev.teckids.org/oauth/token/" [pam] -# You might want to put these into a separate file nss_pam_oidc.secret.toml! +# You might want to put these into a separate file nss_pam_webapi.secret.toml! client_id = "Df1cpPEBsbG64oZ1Q1L8NetH1UKNBUyA5qhxg1Zh" client_secret = "" [nss] -# You might want to put these into a separate file nss_pam_oidc.secret.toml! +# You might want to put these into a separate file nss_pam_webapi.secret.toml! client_id = "z8Oz0tG56QRo9QEPUZTs5Eda410FMiJtYxlInxKE" client_secret = "" diff --git a/src/lib.rs b/src/lib.rs index 109b9bbb7e39e41536cc52ee063efffe9969aa1c..983bd330a7401071b52d2c8e3355445a98e0e870 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -const BASE_NAME: &str = "nss_pam_oidc"; +const BASE_NAME: &str = "nss_pam_webapi"; // Modules and macro imports for our own code #[macro_use] extern crate log; diff --git a/src/nss.rs b/src/nss.rs index 8bf7ba587f92b407628a72d81415745df90a56c2..0b549737a246dcf253cd65c7fe6841cd6589c5bf 100644 --- a/src/nss.rs +++ b/src/nss.rs @@ -157,4 +157,4 @@ impl PasswdHooks for OidcPasswd { } } -libnss_passwd_hooks!(oidc, OidcPasswd); +libnss_passwd_hooks!(webapi, OidcPasswd);