isururanawaka commented on issue #83:
URL: https://github.com/apache/airavata-custos/issues/83#issuecomment-647861339


   > I have a few queries regarding the agent management client:
   > 
   > **1. What is an agent?**
   
   Agents are similar to Service Accounts. For instance, a tenant that has 
distributed bots performing different work under different privileges needs a 
mechanism to authenticate its bots to resource servers. But, tenant cannot 
share its credentials with bots.  In such a scenario, the tenant can register 
agents and obtain different credentials for agents.
   
   First, you need to have an activated tenant to use Agents.
   One tenant can have multiple agents. agents are independent clients that can 
obtain OAuth tokens. Agents store attributes and roles and can embed them on 
their tokens.
   
    
    -> you need to enable agents
     -> register agent 
            (This would give clientID and Secret for agent)
     -> log using client credentials grant type.
   
   First, try out following REST endpoints of Agent Management
   
https://docs.google.com/document/d/1WjnADghys2Z-L8smOJtbal7vVcZI11oBBfBz83p88VM/edit#heading=h.d4gkngk38px3
      Note: replace port with  /apiserver/
   
   > **2. In the agent management client samples, a username and password is 
used to get a token. Can we obtain some username and password for running our 
test cases**
   > 
   > ```
   > def register_and_enable():
   >     agent = {
   >         "id": "agent-asdasda-ebnmvf",
   >         "realm_roles": [],
   >         "attributes": [{
   >             "key": "agent_cluster_id",
   >             "values": ["123123131"]
   >         }]
   >     }
   >     id_res = id_client.token(token, username="isjarana", 
password="Custos1234", grant_type="password")
   >     response = client.register_and_enable_agent(id_res['access_token'], 
agent)
   >     print(response)
   > 
   > register_and_enable()
   > ```
   > 
   > **What credentials can we use for running a similar code in test case?**
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to