Skip to content

InProcessResolver JsonSchemaValidator should be able to get the targeting.json and flags.json without calling flagd.dev #474

@sg-baill

Description

@sg-baill

Problem

Hi, we use the InProcessResolver but the JsonSchemaValidator tries to call https://flagd.dev/ to fetch targeting.json and flags.json files. In an environment without access to public internet this behaviour is broken.

  internal JsonSchemaValidator(HttpClient client, ILogger logger)
    {
        if (client == null)
        {
            client = new HttpClient
            {
                BaseAddress = new Uri("https://flagd.dev"),
            };
        }

        _client = client;
        _logger = logger;
    }

Proposals

Override BaseAdress in configuration

Add extra property into FlagdProviderOptions and FlagdConfig to override BaseAdress of the HttpClient used into the JsonSchemaValidator

Use FlagsRetriever and TargetingRetriever

Provide to JsonSchemaValidator two parameters in its constructor to fetch targeting.json, flags.json JsonSchema, this two parameters are provided by the client code and are free implementations. Client could for example get the schemas from the file system or generate them from scratch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    provider:flagdIssues related to provider flagd

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions