strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

Using Loopback recommended approach to exclude properties from the base model. #84

Closed extremal closed 5 years ago

extremal commented 5 years ago

Description

Fields which were excluded by setting them null in the model json file were still included into the select expression in the query. That was generating broken sql queries because fields were physically absent in the database (expected):

STATEMENT: SELECT "id","clienttype","redirecturis","tokenendpointauthmethod","granttypes","responsetypes","tokentype","clientsecret","clientname","clienturi","logouri","scopes","contacts","tosuri","policyuri","jwksuri","jwks","softwareid","softwareversion","realm","name","description","owner","collaborators","email","emailverified","clientkey","javascriptkey","restapikey","windowskey","masterkey","pushsettings","status","created","modified","icon","url","callbackurls","permissions","authenticationenabled","anonymousallowed","authenticationschemes" FROM "public"."oauthclientapplication" WHERE "id"=$1 ORDER BY "id" LIMIT 1

Using the recommended Loopback approach to exclude properties from the base model fixed the issue for me. https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html#exclude-properties-from-base-model

Related issues

Checklist

slnode commented 5 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

jannyHou commented 5 years ago

@slnode test please

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.