node-authz-client
v1.5.7
Published
[PoC] Node Authz Client
Readme
Description
A package for integration with authz service
Installation
You can install this package using npm:
npm install node-authz-client
Usage
import { Configuration, NodeAuthzClient } from 'node-authz-client';
(async () => {
const apiKey = 'abc';
const baseUrl = 'https://api.example.com';
const config = new Configuration(baseUrl, apiKey);
const nodeAuthzClient = new NodeAuthzClient(config);
const result = await nodeAuthzClient.createPermission({
name: 'kiki',
description: 'test',
});
console.log(result);
})();Verify Linked User
The Verify Linked User function is used to verify whether a user is connected to Kairos Connect. If the user is already connected to Kairos Connect, the function will return true. If the user is not connected or an error occurs within the function, it will return false to prevent blocking the client application
Params
- customerRefId: userId dari client (KFI/KSI/Sindikasi)
- appId: appId dari aplikasi client (Rekomendasi: Store di .env)
Example:
async verify(body: VerifyLinkedUserDto) {
const nodeAuthz = this._initNodeAuthzClient();
const isLinked = await nodeAuthz.verifyLinkedUser(
body.customerRefId,
body.appId,
);
return isLinked;
}Returning: Boolean
- true: Already connected to KC
- false: Not yet connected to KC
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
(Latest) [1.6.0] - 2025-03-06
Feat
- Add
POST /verify-linked-userasverifyLinkedUserto verify if the client user account is already connected to the kairos connect
[1.5.7] - 2025-01-21
Feat
- Add
POST /validate-tokento validate access token to firebase authentication - Add
accessTokenVerifyto validate access token to firebase authentication - Add
GET /user-role-permissions/validateto validate access token with permission code - Add
permissionVerifyto validate access token with permission code
[1.5.0] - 2024-12-26
Feat
- Modify API
getUserByIdandgetUserByRefId
[1.4.0] - 2024-10-04
Fixed
- Change parameter for self sign order
- Change parameter for self sign verify order
[1.1.23] - 2024-10-04
Fixed
- Fix to make package compatible with node >= 16.0.0
[1.1.23] - 2024-09-25
Added
- Add
POST /apps/verifyto verify signature of request - Add
selfSignVerifyto verify signature of request (using self stored public key) - Add
selfSignCreateto create signature of request (using self stored private key)
Fixed
- Fix problem where
undcion Firebase package is not working related to https://github.com/nodejs/undici/issues/2512
