From 8704acbc5e7a87cbdfc9f89700a6feecce471a7d Mon Sep 17 00:00:00 2001 From: axi92 Date: Mon, 25 Nov 2024 09:38:59 +0100 Subject: [PATCH 1/6] docs: add link to license --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cfd324b..b173a46 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Description -Client implementation for the EVVA [Auth Service]. +Client implementation for the EVVA Auth Service. ## Build & Package ```bash @@ -61,4 +61,4 @@ export class MyModule implements OnModuleInit { ## License -Proprietary +[Proprietary](LICENSE) From e23977e5333526198d95560e2fb4dc195fc2d514 Mon Sep 17 00:00:00 2001 From: axi92 Date: Mon, 25 Nov 2024 09:57:09 +0100 Subject: [PATCH 2/6] chore: add changelog file --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a8c4be8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +Will be autogenerated on next release From 60ee8626e7afdb26a080ef30970d8391d490e689 Mon Sep 17 00:00:00 2001 From: axi92 Date: Mon, 25 Nov 2024 12:55:07 +0100 Subject: [PATCH 3/6] docs: add badges --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b173a46..5b17b0f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,11 @@ -## Description +# Nest Auth Client + +[![NPM Version](https://img.shields.io/npm/v/%40evva%2Fnest-auth-client)](https://www.npmjs.com/package/@evva/nest-auth-client) +[![NPM Downloads](https://img.shields.io/npm/dy/%40evva%2Fnest-auth-client)](https://www.npmjs.com/package/@evva/nest-auth-client) +![NPM Unpacked Size (with version)](https://img.shields.io/npm/unpacked-size/%40evva%2Fnest-auth-client/latest) +![GitHub last commit](https://img.shields.io/github/last-commit/evva-sfw/nest-auth-client) +[![GitHub branch check runs](https://img.shields.io/github/check-runs/evva-sfw/nest-auth-client/main)]([URL](https://github.com/evva-sfw/nest-auth-client/actions)) +[![EVVA License](https://img.shields.io/badge/license-EVVA_License-yellow.svg?color=fce500&logo=data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0MCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgNjQwIDEwMjQiPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiNmY2U1MDAiIGQ9Ik02MjIuNDIzIDUxMS40NDhsLTMzMS43NDYtNDY0LjU1MmgtMjg4LjE1N2wzMjkuODI1IDQ2NC41NTItMzI5LjgyNSA0NjYuNjY0aDI3NS42MTJ6Ij48L3BhdGg+Cjwvc3ZnPgo=)](LICENSE) Client implementation for the EVVA Auth Service. From 2f9bc54b6eee9a18d386c46057381ccc78e78c8c Mon Sep 17 00:00:00 2001 From: axi92 Date: Tue, 26 Nov 2024 09:17:18 +0100 Subject: [PATCH 4/6] docs: refine usage in readme --- README.md | 53 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5b17b0f..c5aaed4 100644 --- a/README.md +++ b/README.md @@ -9,50 +9,55 @@ Client implementation for the EVVA Auth Service. -## Build & Package -```bash -# Nest Build -$ nest build -``` +## Install + ## Usage -``` - import {ConfigService } from '@nestjs/config'; - import { - AuthClientModule, - AuthClientService, - AuthClientOptions, - AUTH_ENDPOINT, - AUTH_TENANT, +*In app.module.ts as imports* + +```ts +import { ConfigModule, ConfigService } from '@nestjs/config'; +import { AUTH_CLIENT, + AUTH_ENDPOINT, AUTH_SECRET, + AUTH_TENANT, AUTH_VALIDITY, - VAULT_JWTROLE_IDENTIFIER, - VAULT_ENDPOINT, + AuthClientModule, + AuthClientModuleOptions, VAULT_CA, + VAULT_ENDPOINT, + VAULT_JWTROLE_IDENTIFIER, } from '@evva/nest-auth-client'; - AuthClientModule.forRootAsync({ +@Module({ + imports: [ + AuthClientModule.forRootAsync({ imports: [ConfigModule], inject: [ConfigService], - useFactory: async (configService: ConfigService) => + useFactory: async (configService: ConfigService) => ({ authEndpoint: configService.get(AUTH_ENDPOINT), //use optional authTenant: configService.get(AUTH_TENANT), authClientId: configService.get(AUTH_CLIENT), authClientSecret: configService.get(AUTH_SECRET), authValidity: parseInt(configService.get(AUTH_VALIDITY)), // in seconds, see spec - vaultRoleId: configService.get(AULT_JWTROLE_IDENTIFIER), + vaultRoleId: configService.get(VAULT_JWTROLE_IDENTIFIER), vaultEndpoint: configService.get(VAULT_ENDPOINT), - vaultCA: configService.get(VAULT_CA) - }) as AuthClientOptions, + vaultCA: configService.get(VAULT_CA), + }) as AuthClientModuleOptions, }), + ], + controllers: [AppController], + providers: [AppService], +}) +export class AppModule {} ``` When using the ConfigService, make sure that the variables are loaded before accessing them. This usually works as follows: -``` +```ts export class MyModule implements OnModuleInit { @@ -62,6 +67,12 @@ export class MyModule implements OnModuleInit { } ``` +## Build & Package +```bash +# Nest Build +$ nest build +``` + ## Support ## Stay in touch From baf8c457ae061a5b6cab79553247005c36de27d9 Mon Sep 17 00:00:00 2001 From: axi92 Date: Tue, 26 Nov 2024 17:52:50 +0100 Subject: [PATCH 5/6] docs: remove usage comment --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c5aaed4..762e20e 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Client implementation for the EVVA Auth Service. ## Usage -*In app.module.ts as imports* - ```ts import { ConfigModule, ConfigService } from '@nestjs/config'; import { From eff6b65e07a731a96eda558b5aa591490117bbc5 Mon Sep 17 00:00:00 2001 From: axi92 Date: Thu, 28 Nov 2024 17:31:29 +0100 Subject: [PATCH 6/6] docs: add install note --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 762e20e..6a716eb 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Client implementation for the EVVA Auth Service. ## Install +`npm i @evva/nest-auth-client` ## Usage