Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method CanInsert..Property of the controllers always return true #235

Closed
gekiss opened this issue Sep 24, 2024 · 3 comments
Closed

Method CanInsert..Property of the controllers always return true #235

gekiss opened this issue Sep 24, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gekiss
Copy link

gekiss commented Sep 24, 2024

Describe the bug

The methods:
CanInsertApiResourceProperty of the ApiResourcesController
CanInsertApiScopeProperty of the ApiScopesController
CanInsertIdentityResourceProperty of the IdentityResourcesController
always return true value

To Reproduce

Create new Api Resource

curl -X 'POST' \
  'https://localhost:44302/api/ApiResources' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer eyJ...' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 0,
  "name": "string",
  "displayName": "string",
  "description": "string",
  "enabled": true,
  "showInDiscoveryDocument": true,
  "requireResourceIndicator": true,
  "userClaims": [
    "string"
  ],
  "allowedAccessTokenSigningAlgorithms": [
    "string"
  ],
  "scopes": [
    "string"
  ]
}'
{
  "id": 5,
  "name": "string",
  "displayName": "string",
  "description": "string",
  "enabled": true,
  "showInDiscoveryDocument": true,
  "requireResourceIndicator": true,
  "userClaims": [
    "string"
  ],
  "allowedAccessTokenSigningAlgorithms": [
    "string"
  ],
  "scopes": [
    "string"
  ]
}

Validate the property with key key exists for resource, return true as expected

url -X 'GET' \
  'https://localhost:44302/api/ApiResources/CanInsertApiResourceProperty?id=5&key=key' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ...' \
true

Add the property with key key and value value to the resource

curl -X 'POST' \
  'https://localhost:44302/api/ApiResources/5/Properties' \
  -H 'accept: */*' \
  -H 'Authorization: Bearer eyJ...' \
  -H 'Content-Type: application/json' \
  -d '{
  "key": "key",
  "value": "value"
}'
{
  "id": 1,
  "key": "key",
  "value": "value"
}

Validate the property with key key exists for resource, return true, but expected false

url -X 'GET' \
  'https://localhost:44302/api/ApiResources/CanInsertApiResourceProperty?id=5&key=key' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJ...' \
true 
@skoruba
Copy link
Owner

skoruba commented Sep 25, 2024

I will check it, thanks!

@skoruba
Copy link
Owner

skoruba commented Sep 25, 2024

There is a bug, I will release the fix in 2.4.0 soon.
Thanks for letting me know.

@skoruba skoruba added the bug Something isn't working label Sep 25, 2024
@skoruba skoruba mentioned this issue Sep 28, 2024
6 tasks
@skoruba
Copy link
Owner

skoruba commented Sep 29, 2024

Released in 2.4.0.
Thanks!

@skoruba skoruba closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants