HumanCellAtlas / fusillade

Federated User Identity Login & Access Decision Engine
https://fusillade.readthedocs.io/
Other
8 stars 1 forks source link

unable to upload v1/resource/{resource_type_name} #383

Open amarjandu opened 4 years ago

amarjandu commented 4 years ago

I believe the regex used to verify the resource_type_name is verified against the wrong schema... I'm unable to call the command hca auth post-v1-resource --resource-type-name dss:project

Within the YAML:

    resource_type_name:
      name: resource_type_name
      in: path
      required: true
      description: The name of a type of resources to which a resource policy can be applied.
      schema:
        $ref: '#/components/schemas/custom_identifier'

i think the ref should change to $ref: '#/components/schemas/resource_name'

But i could be mistaken // not using the api correctly.

amarjandu commented 4 years ago

Related to this issue, if i try to name the resource_type to = projects I end up with,

{
  "detail": "'string' does not match '[A-z]\\\\w*[^\\\\W_]:[A-z]\\\\w*[^\\\\W_]'",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

I don't see this regex string within the repository, the closest thing seems to be policy_action https://github.com/HumanCellAtlas/fusillade/blob/691b9049e2057f735c4611a6bd1acae752be6149/fusillade-api.yml#L1506

amarjandu commented 4 years ago

The swagger page, shows a policy document present within the default json object that is sent up with the request. Upon removing the owner_policy object, the request was created/handled correctly..

https://github.com/HumanCellAtlas/fusillade/blob/691b9049e2057f735c4611a6bd1acae752be6149/fusillade-api.yml#L962