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

* Fix bug where overriden query was ignored. Fixes GH-83 #84

Merged
merged 1 commit into from Feb 19, 2020
Merged

Conversation

@plorenz
Copy link
Member

plorenz commented Feb 14, 2020

  • Allow routers to referenced by name when creating services. Fixes GH-76

  • Allow admins to view services as other users

  • Allow anyone to change the requested config types shown in a services list

* Allow routers to referenced by name when creating services. Fixes GH-76

* Allow admins to view services as other users

* Allow anyone to change the requested config types shown in a services list
configTypes = mapConfigTypeNamesToIds(ae, strings.Split(requestedConfigTypes, ","), identity.Id)
}

result, err := ae.Handlers.Service.PublicQueryForIdentity(identity, configTypes, queryOptions)

This comment has been minimized.

Copy link
@andrewpmartinez

andrewpmartinez Feb 19, 2020

Contributor

Been wondering what PublicQuery means.

This comment has been minimized.

Copy link
@plorenz

plorenz Feb 19, 2020

Author Member

PublicQuery is mean to be called for queries which come from the APIs. It checks that queries are using only local symbols and aren't chaining symbols.

So for example when querying service, name in ["foo", "bar"], createdAt > someDate is ok, but sessions.identity.name = "Admin" would result in an error.

Internal users would use just Query and wouldn't restricted in the symbols available to them

@plorenz plorenz merged commit a677c7d into master Feb 19, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@plorenz plorenz deleted the misc-fixes branch Feb 19, 2020
identity := rc.Identity
if rc.Identity.IsAdmin {
if asId := rc.Request.URL.Query().Get("asIdentity"); asId != "" {
var err error
identity, err = ae.Handlers.Identity.ReadOneByQuery(fmt.Sprintf(`id = "%v" or name = "%v"`, asId, asId))
if err != nil {
return nil, err
}
if identity == nil {
return nil, util.NewNotFoundError("identity", "id or name", asId)
}
}
}
Comment on lines +79 to +91

This comment has been minimized.

Copy link
@plorenz

plorenz Feb 24, 2020

Author Member

@dovholuknf @mikegorman-nf implementation code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.