Updating authentication and token management flow to accomodate context switching of agent for different roles based on type of agent (multi-tenant or dedicated) and different role in multi-tenancy(dedicated and tenant)
[x] Token creation for different roles (Basewallet (BW), Tenant Wallet(TW), Dedicated agent wallet(DW))
[x] Authenticating token based on endpoints being accessed and type of token(authorization)
[x] Attaching agent context based on roles through request
[ ] Secret keys used for generating and verifying tokens for BW and TW in case of multi-tenancy will be same and stored in BW. (Since, opening wallet to access secretKey for each request in case of tenant agent verification will be an expensive process in terms of time and computation)
[x] Removing middleware and utilizing authentication module for authorization and context switching
[x] Handling error for unauthorized access
[x] Receiving apiKey as an additional parameter while staring the agent. This will act as an authentication for BW and DW
[ ] Releasing agent session at the end of request
[x] Using agent context from request for all endpoints. (Unlike as a global param currently being used in controllers)
Updating authentication and token management flow to accomodate context switching of agent for different roles based on type of agent (multi-tenant or dedicated) and different role in multi-tenancy(dedicated and tenant)