[PoC] Node Authz Client
npm install node-authz-clientA package for integration with authz service
You can install this package using npm:
npm install node-authz-client
``javascript
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);
})();
`
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:
`typescript`
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
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.
- Add POST /verify-linked-user as verifyLinkedUser to verify if the client user account is already connected to the kairos connect
- Add POST /validate-token to validate access token to firebase authenticationaccessTokenVerify
- Add to validate access token to firebase authenticationGET /user-role-permissions/validate
- Add to validate access token with permission codepermissionVerify
- Add to validate access token with permission code
- Modify API getUserById and getUserByRefId
- Change parameter for self sign order
- Change parameter for self sign verify order
- Fix to make package compatible with node >= 16.0.0
- Add POST /apps/verify to verify signature of requestselfSignVerify
- Add to verify signature of request (using self stored public key)selfSignCreate
- Add to create signature of request (using self stored private key)
- Fix problem where undci` on Firebase package is not working related to https://github.com/nodejs/undici/issues/2512