Skip to content

Commit b933ec9

Browse files
author
Jeny Sadadia
committed
kernelci.cli.user: send API token to GET user matching ID
Send API token for getting user matching given ID as the endpoint has made accessible to only authorized users. Signed-off-by: Jeny Sadadia <[email protected]>
1 parent 5892dfa commit b933ec9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernelci/cli/user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,17 @@ def verify(username, config, api):
139139
click.echo("Email verification successful!")
140140

141141

142-
@kci_user.command
142+
@kci_user.command(secrets=True)
143143
@click.argument('user_id')
144144
@Args.config
145145
@Args.api
146146
@Args.indent
147147
@catch_http_error
148-
def get(user_id, config, api, indent):
148+
def get(user_id, config, api, indent, secrets):
149149
"""Get a user with a given ID"""
150150
configs = kernelci.config.load(config)
151151
api_config = configs['api'][api]
152-
api = kernelci.api.get_api(api_config)
152+
api = kernelci.api.get_api(api_config, secrets.api.token)
153153
user = api.get_user(user_id)
154154
click.echo(json.dumps(user, indent=indent))
155155

0 commit comments

Comments
 (0)