Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Credo Controller - authentication and context switching for types of agent #100

Open
8 of 10 tasks
GHkrishna opened this issue Apr 25, 2024 · 1 comment
Open
8 of 10 tasks
Assignees

Comments

@GHkrishna
Copy link
Contributor

GHkrishna commented Apr 25, 2024

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)

  • Token creation for different roles (Basewallet (BW), Tenant Wallet(TW), Dedicated agent wallet(DW))
  • Authenticating token based on endpoints being accessed and type of token(authorization)
  • Attaching agent context based on roles through request
  • G̶e̶n̶e̶r̶a̶t̶i̶n̶g̶ a̶n̶d̶ s̶t̶o̶r̶i̶n̶g̶ i̶n̶d̶i̶v̶i̶d̶u̶a̶l̶ s̶e̶c̶r̶e̶t̶ k̶e̶y̶ f̶o̶r̶ e̶a̶c̶h̶ t̶y̶p̶e̶ o̶f̶ u̶s̶e̶r̶ (̶i̶.e̶. D̶W̶, B̶W̶ a̶n̶d̶ T̶W)̶ i̶n̶ t̶h̶e̶i̶r̶ w̶a̶l̶l̶e̶t̶ t̶o̶ g̶e̶n̶e̶r̶a̶t̶e̶ a̶n̶d̶ v̶e̶r̶i̶f̶y̶ j̶w̶t̶ t̶o̶k̶e̶n̶s̶ -
  • 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)
  • Removing middleware and utilizing authentication module for authorization and context switching
  • Handling error for unauthorized access
  • 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
  • Using agent context from request for all endpoints. (Unlike as a global param currently being used in controllers)
@GHkrishna GHkrishna self-assigned this Apr 25, 2024
@GHkrishna GHkrishna changed the title refactor: token management refactor: authentication and context switching for types of agent Apr 25, 2024
@GHkrishna GHkrishna changed the title refactor: authentication and context switching for types of agent refactor: Update Credo Controller - authentication and context switching for types of agent May 8, 2024
@GHkrishna GHkrishna changed the title refactor: Update Credo Controller - authentication and context switching for types of agent refactor: Credo Controller - authentication and context switching for types of agent May 8, 2024
@GHkrishna
Copy link
Contributor Author

Moving this as Hold as it was less in priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant