Conditional custom fields

Hello Team,

We are looking to use replicated for our internal product feature management where we want to utilize custom license fields that way we can check if the feature is enabled for specific clients or not.

Is there any way that we can add the conditional custom field like if the client chooses to use one feature then show specific field only.

For eg. below-

If LicenseType Field=‘UserBased’
then show below custom fields
-number of users
-parallel jobs

if LicenseType Field=‘ServerBased’
then show below custom fields
-number of servers
-some other field

we are looking for this feature to avoid human error since license creation is mainly handled by a non-technical team and chances is they could miss some field which may cause any issue in app.

Is it possible to achieve this?

You could use the when condition on the config items, think that is what you’re asking for, example:

    - name: database
      title: "Postgresql Settings:"
      items:

        ### When Feature Flag: Embedded Postgres is available ###
        - name: postgres_type
          help_text: Would you like to use an embedded postgres instance, or connect to an external instance that you manage?
          type: select_one
          title: Postgres
          default: embedded_postgres
          items:
            - name: embedded_postgres
              title: Embedded Postgres
            - name: external_postgres
              title: External Postgres
          when: '{{repl eq (LicenseFieldValue "feature-flag-embedded-pg") "1" }}'

Hi @grahamnscp , Thank you for your response, Basically, I am looking for this kind of solution in the vendor portal instead of the admin console.

Hi @dmuley, I did something similar. I created a “Replicated” licensor which retrieves the data from http://kotsadm:3000/license/v1/license and then interrogated what was in there so we could add our own feature sets in there.

The only problem with this is that someone could bypass the licencing entirely by creating their own service on that endpoint to spoof the licence data. For us, that was an acceptable compromise. We did raise a feature request to allow us to inject licence information into a secret and then validate the signature against a public signature from Replicated, but nothing happened with that.

See gitpod/replicated.go at main · gitpod-io/gitpod · GitHub

Hello @MrSimonEmms, Thanks for sharing. I will take a look.

1 Like