thechosenone
thechosenone

Reputation: 75

User RemoteConfig with Firebase Database Rules

Is there a way to access remoteconfig with database rules? so that I can setup a .validate rule? like

remote config: max_username_length = 10, and then does exists something in rules like?

".validate":"remoteConfig.max_username_length > newData.val()"

or something like that?

Upvotes: 1

Views: 255

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599706

firebaser here

There is currently no way to access Remote Config variables from the Firebase Database security rules.

Remote Config is used to push configuration data to each client, while security are evaluated on the server. So I don't immediately see how/why to allow such a connection.

If you want user-specific configuration data for use in the database security rules, it is easier to keep that configuration data in the database itself. E.g.

userConfig
  $uid
    config1: "value1"
    config1: true

Upvotes: 4

Related Questions