diff --git a/platformio/clients/registry.py b/platformio/clients/registry.py index 1a3626de..c48094ee 100644 --- a/platformio/clients/registry.py +++ b/platformio/clients/registry.py @@ -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 + ) diff --git a/platformio/commands/access.py b/platformio/commands/access.py index 92efce28..2ca72fd6 100644 --- a/platformio/commands/access.py +++ b/platformio/commands/access.py @@ -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: