-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Parse Config with ACL #5930
Comments
Hi @mtrezza |
@Moumouls config parameters in cloud code can be useful if they
|
I think like @davimacedo that you need to use a class why:
A suggestion for your use case// Not optimized: The full config is pulled from DB
const config = await Parse.Config.get()
// Not tested: Optimized and secure, (name field should be indexed), InternalConfig need to be protected by CLP
const getInternalConfig = async (...args) => {
const config = {}
(await (new Parse.Query('InternalConfig'))
.containedIn('name', args)
.find({useMasterKey: true}))
.forEach(result => config[result.get("name")] = config[result.get("value")]
return config
}
const optimizedConfig = await getInternalConfig("parameter1", "parameter4" ) |
@Moumouls I like it, I’ll go with a class. Mainly because its cheaper to query only the parameters needed. |
Just to mention some advantages of Parse Config compared to a custom class:
To @Moumouls' arguments I would respond:
Because of that I hereby reopen for further discussion :) |
Actually the PR seems fairly simple:
Did I forget anything? |
Seems good to me ! |
I don't see any problem and I'd be happy to review the PRs. |
I’ll give it a shot. |
PRs are ready for review: |
Coud be interesting to implement the feature on I guess it's a little PR 😉 @mtrezza Do you think you can take a look at it? |
SuggestionIn addition of the current input: Parse.Config.save({
welcomeMesssage : "Welcome to Parse",
ageOfParse : 3,
tags : ["parse","sdk","js"]
}) We can support this type of input: Parse.Config.save({
welcomeMesssage : "Welcome to Parse",
ageOfParse : 3,
tags : ["parse","sdk","js"]
aPrivateConfigField: {
value: "ImPrivate",
masterKeyOnly: true
}
}) |
@Moumouls We have a working feature, my suggestion is to add that in another PR. |
PR waiting to be merged: PRs merged: |
I’ll merge the docs pr once new releases have been made for the server and dashboard. |
@TomWFox Please reopen. I just realized that some changes need to be made in the JS SDK as well. The tests passed because they use REST requests, but the JS SDK does not regard the So |
@Moumouls Eventually the functionality you requested has been added in parse-community/Parse-SDK-JS#910. |
@mtrezza I think we can now close this one, right? |
We can! Thanks everyone for their support! 🚀 |
Reopened, because Parse Server 3.8.0 still points to Parse SDK 2.6.0 instead of 2.7.1. @davimacedo can we please create a Parse Server release to point to the current JS SDK? I will open a PR for the dashboard, which currently requires Parse Server 3.8.0 for the feature, but it should actually be the new release version. |
@davimacedo None that I can think of. Go for it! |
Is your feature request related to a problem? Please describe.
Parse Config is a convenient way to remotely configure client parameters. It can also be used in Cloud Code to conveniently configure global parameters like this:
However, using Parse Config for both poses a problem, as all config parameters are exposed to the client. Cloud Code parameters are of internal nature and it may not be wanted to expose these to clients. In that case Parse Config cannot be used for Cloud Code.
Describe the solution you'd like
Implement ACL for config parameters, on a per-parameter basis.
Public
so it would not pose a breaking change.useMasterKey
in cloud code. A per-user / per-role ACL configuration could be omitted if that reduces implementation efforts.Describe alternatives you've considered
As @davimacedo proposed, the alternative would be to create a class and configure the parameters there. This is a working but not elegant solution since we already have Parse Config for that sort of functionality.
The text was updated successfully, but these errors were encountered: