Skip to content

Commit f87f036

Browse files
yeshamavanivaibhavbhalla2505
authored andcommitted
docs(tenant-management): update the readme
GH-109
1 parent 10db513 commit f87f036

File tree

2 files changed

+109
-7
lines changed

2 files changed

+109
-7
lines changed

services/tenant-management-service/README.md

Lines changed: 109 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[![LoopBack](<https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected]>)](http://loopback.io/)
44

5-
This is the primary service of the control plane responsible for onboarding a tenant and triggering it's provisioning.
5+
This is the primary service of the ARC SaaS control plane responsible for onboarding a tenant and managing it's provisioning.
66

77
## Overview
88

99
A Microservice for handling tenant management operations. It provides -
1010

11-
- lead creation and verification
11+
- Lead creation and verification
1212
- Tenant Onboarding of both pooled and silo tenants
1313
- Billing and Invoicing
1414
- Provisioning of resources for silo and pooled tenants
@@ -35,12 +35,23 @@ $ [npm install | yarn add] @sourceloop/ctrl-plane-tenant-management-service
3535
- Set the [environment variables](#environment-variables).
3636
- Run the [migrations](#migrations).
3737
- Add the `TenantManagementServiceComponent` to your Loopback4 Application (in `application.ts`).
38+
3839
```typescript
3940
// import the TenantManagementServiceComponent
4041
import {TenantManagementServiceComponent} from '@sourceloop/ctrl-plane-tenant-management-service';
4142
// add Component for TenantManagementService
4243
this.component(TenantManagementServiceComponent);
4344
```
45+
46+
This microservice uses [loopback4-authentication](https://www.npmjs.com/package/loopback4-authentication) and [@sourceloop/core](https://www.npmjs.com/package/@sourceloop/core) and that uses asymmetric token encryption and decryption by default for that setup please refer [their](https://www.npmjs.com/package/@sourceloop/authentication-service) documentation but if you wish to override and use symmetric encryption add the following to your `application.ts` file along with other config values.
47+
48+
```typecript
49+
this.bind(TenantManagementServiceBindings.Config).to({
50+
useCustomSequence:true,
51+
});
52+
53+
```
54+
4455
- Set up a [Loopback4 Datasource](https://loopback.io/doc/en/lb4/DataSource.html) with `dataSourceName` property set to
4556
`TenantManagementDB`. You can see an example datasource [here](#setting-up-a-datasource).
4657
- Bind any of the custom [providers](#providers) you need.
@@ -54,12 +65,15 @@ $ [npm install | yarn add] @sourceloop/ctrl-plane-tenant-management-service
5465
- The mail has a link which should direct to a front end application, which in turn would call the upcoming api's using a temporary authorization code included in the mail.
5566
- The front end application first calls the `/leads/{id}/verify` which updates the validated status of the lead in the DB and returns a new JWT Token that can be used for subsequent calls
5667
- If the token is validated in the previous step, the UI should call the `/leads/{id}/tenants` endpoint with the necessary payload(as per swagger documentation).
57-
- This endpoint would onboard the tenant in the DB, and the facade is then supposed to trigger the relevant events using the `/tenants/{id}/provision` endpoint.
68+
- This endpoint would onboard the tenant in the DB, and its success you should trigger the relevant events using the `/tenants/{id}/provision` endpoint.
69+
- The provisioning endpoint will invoke the publish method on the `EventConnector`. This connector's purpose is to provide a place for consumer to write the event publishing logic. And your custom service can be bound to the key `EventConnectorBinding` exported by the service.
5870

5971
## Event Publishing
60-
This service now supports pluggable event strategies — EventBridge, SQS, and BullMQ — through the loopback4-message-bus-connector.
72+
73+
The service supports pluggable event strategies — EventBridge, SQS, and BullMQ — through the loopback4-message-bus-connector.
6174

6275
You can publish provisioning or deployment events by injecting a Producer for your desired message bus strategy.
76+
6377
```ts
6478
import {producer, Producer, QueueType} from 'loopback4-message-bus-connector';
6579

@@ -86,7 +100,6 @@ export class TenantEventPublisher {
86100
});
87101
}
88102
}
89-
90103
```
91104

92105
## IDP - Identity Provider
@@ -350,7 +363,96 @@ The identity provider and its related providers are also a part of the 'WebhookT
350363
<td>lenght of random key for lead.</td>
351364
<td></td>
352365
</tr>
353-
366+
<tr>
367+
<td>AUTH0_DOMAIN</td>
368+
<td>Y for Auth0</td>
369+
<td>Domain</td>
370+
<td></td>
371+
</tr>
372+
<tr>
373+
<td>AUTH0_CLIENT_ID</td>
374+
<td>Y for Auth0</td>
375+
<td>Client id of the Auth0 Application</td>
376+
<td></td>
377+
</tr>
378+
<tr>
379+
<td>AUTH0_CLIENT_SECRET</td>
380+
<td>Y for Auth0</td>
381+
<td>Client secret of the Auth0 Application</td>
382+
<td></td>
383+
</tr>
384+
<tr>
385+
<td>AUTH0_AUDIENCE</td>
386+
<td>N</td>
387+
<td>Recipient of the token</td>
388+
<td></td>
389+
</tr>
390+
<tr>
391+
<td>AWS_REGION</td>
392+
<td>Y for Keycloak</td>
393+
<td>AWS region for SSM</td>
394+
<td></td>
395+
</tr>
396+
<tr>
397+
<td>NAMESPACE</td>
398+
<td>Y for Keycloak</td>
399+
<td>SSM namespace</td>
400+
<td></td>
401+
</tr>
402+
<tr>
403+
<td>KEYCLOAK_HOST</td>
404+
<td>Y for keycloak</td>
405+
<td>Keycloak host URL</td>
406+
<td></td>
407+
</tr>
408+
<tr>
409+
<td>KEYCLOAK_ADMIN_USERNAME</td>
410+
<td>Y for Keycloak</td>
411+
<td>Username of Admin</td>
412+
<td></td>
413+
</tr>
414+
<tr>
415+
<td>KEYCLOAK_ADMIN_PASSWORD</td>
416+
<td>Y for Keycloak</td>
417+
<td>Password of Admin</td>
418+
<td></td>
419+
</tr>
420+
<tr>
421+
<td>AWS_SES_SMTP_HOST</td>
422+
<td>Y for Keycloak</td>
423+
<td>SMTP host URL</td>
424+
<td></td>
425+
</tr>
426+
<tr>
427+
<td>AWS_SES_SMTP_USERNAME</td>
428+
<td>Y for Keycloak</td>
429+
<td>SMTP username</td>
430+
<td></td>
431+
</tr>
432+
<tr>
433+
<td>AWS_SES_SMTP_PASSWORD</td>
434+
<td>Y for Keycloak</td>
435+
<td>SMTP password</td>
436+
<td></td>
437+
</tr>
438+
<tr>
439+
<td>SMTP_FROM_EMAIL</td>
440+
<td>Y for Keycloak</td>
441+
<td>Emai Id from which you wish to send email</td>
442+
<td></td>
443+
</tr>
444+
<tr>
445+
<td>SMTP_FROM_DISPLAY_NAME</td>
446+
<td>Y for Keycloak</td>
447+
<td>Display name</td>
448+
<td></td>
449+
</tr>
450+
<tr>
451+
<td>DOMAIN_NAME</td>
452+
<td>Y for Keycloak</td>
453+
<td>Your domain name</td>
454+
<td></td>
455+
</tr>
354456
</tbody>
355457
</table>
356458

@@ -376,7 +478,7 @@ const config = {
376478
};
377479

378480
@lifeCycleObserver('datasource')
379-
export class AuthenticationDbDataSource
481+
export class TenantManagementDb
380482
extends juggler.DataSource
381483
implements LifeCycleObserver
382484
{
34.7 KB
Loading

0 commit comments

Comments
 (0)