forked from platformio/platformio-core
Add orgname filter for access list (#3564)
* add orgname filter for access list * fix * fix namings
This commit is contained in:
@ -92,5 +92,7 @@ class RegistryClient(RESTClient):
|
||||
"delete", "/v3/resources/%s/access" % urn, data={"client": client},
|
||||
)
|
||||
|
||||
def list_own_resources(self):
|
||||
return self.send_auth_request("get", "/v3/resources",)
|
||||
def list_resources(self, owner):
|
||||
return self.send_auth_request(
|
||||
"get", "/v3/resources", params={"owner": owner} if owner else None
|
||||
)
|
||||
|
@ -109,11 +109,12 @@ def access_revoke(client, urn, urn_type):
|
||||
|
||||
|
||||
@cli.command("list", short_help="List resources")
|
||||
@click.argument("owner", required=False)
|
||||
@click.option("--urn-type", type=click.Choice(["urn:reg:pkg"]), default="urn:reg:pkg")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def access_list(urn_type, json_output):
|
||||
def access_list(owner, urn_type, json_output):
|
||||
reg_client = RegistryClient()
|
||||
resources = reg_client.list_own_resources()
|
||||
resources = reg_client.list_resources(owner=owner)
|
||||
if json_output:
|
||||
return click.echo(json.dumps(resources))
|
||||
if not resources:
|
||||
|
Reference in New Issue
Block a user