Giter Club home page Giter Club logo

azure-app-configuration-emulator's People

Contributors

dependabot[bot] avatar paulirwin avatar tnc1997 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

azure-app-configuration-emulator's Issues

Keys with slashes (inc. feature flags) return 404

Describe the bug
Attempted to recreate some HTTP calls that work with the real Azure App Config API, like PUT'ing a feature flag, and it fails with a 404 if the key in the URL contains a slash. Feature flags have a key prefix of .appconfig.featureflag/ so the URL is like /kv/.appconfig.featureflag/MyFlagName

Note that the solution is not to URL encode the slash, as that does not match the behavior of Azure App Config.

Current behavior
Steps to reproduce the behavior:

  1. Use Postman to PUT /kv/.appconfig.featureflag/MyFlagName with a valid feature flag body (see below)
  2. 404 is returned instead of expected 200 OK

Example feature flag body:

{
    "key": ".appconfig.featureflag/MyFlagName",
    "label": null,
    "content_type": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8",
    "value": "{\"id\":\"MyFlagName\",\"description\":\"\",\"enabled\":true,\"conditions\":{\"client_filters\":[{\"name\":\"Microsoft.Targeting\",\"parameters\":{\"Audience\":{\"Users\":[],\"Groups\":[],\"DefaultRolloutPercentage\":0}}}]}}",
    "tags": {}
}

Expected behavior
200 OK result

Screenshots
N/A

Additional context
I will attempt to fix this problem and submit a PR.

Add a configuration setting revision entity to the database

Is your feature request related to a problem? Please describe.
As a user I would like historical configuration settings to be stored in the database.

Describe the solution you'd like
The ApplicationDbContext should contain a ConfigurationSettingRevisions property.
The table should be populated by the methods in the ConfigurationSettingRepository.

Add unit tests to cover logic applied to handler inputs

Is your feature request related to a problem? Please describe.
The logic that is applied to handler inputs is currently not covered by unit tests although it should be.

Describe the solution you'd like
I would like to see unit tests added that cover the different possible combinations of handler inputs.

Add support for entity tags and the associated headers

Is your feature request related to a problem? Please describe.
As a user I would like to execute relevant actions conditionally using entity tags and the associated headers.

Describe the solution you'd like
The ConfigurationSetting class should contain an ETag property.
The relevant actions should accept the If-Match and If-None-Match headers.

Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#get-conditionally
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#set-key-conditionally
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#delete-key-conditionally

Add support for HTTPS using an SSL certificate and an SSL certificate key

Is your feature request related to a problem? Please describe.
The emulator currently uses HTTP which is incompatible with Azure App Configuration which requires HTTPS.

Additional context
The implementation should include native support for running the emulator in a Docker container using HTTPS.

Normalize null labels from the list labels endpoint

Describe the bug
Labels returned from the list labels endpoint do not have nulls normalized.

Current behavior

  1. Create a configuration setting with a null label.
  2. List configuration setting labels.
  3. Observe the unnormalized label in the response.

Expected behavior
Labels returned from the list labels endpoint should either be a value of type string or null.

Add support for authentication using HMAC

Is your feature request related to a problem? Please describe.
The emulator does not require authentication which does not align with Azure App Configuration.

Describe the solution you'd like
The emulator requires authentication using the HMAC authentication scheme as documented here.

The entity tag property is not being encoded correctly

Describe the bug
The entity tag property is not being encoded correctly when a configuration setting is added or updated.

Current behavior
Steps to reproduce the behavior:

  1. Send a request to add or update a configuration setting.
  2. Observe the incorrectly encoded value for the entity tag.

Expected behavior
The entity tag property should be encoded as a Base64 string instead of a UTF-8 string.

The last modified and entity tag properties are not being updated

Describe the bug
The last modified and entity tag properties are not being updated when updating a configuration setting.

Current behavior
Steps to reproduce the behavior:

  1. Add a configuration setting.
  2. Make a note of the entity tag value.
  3. Update the added configuration setting.

Expected behavior
The last modified and entity tag properties should be updated.

Distinct configuration setting keys and labels

Describe the bug
Duplicate keys and labels are repeated in the response items array with regards to #4 and #5.

Current behavior

  1. Create multiple configuration settings with the same key but different labels.
  2. List configuration setting keys.
  3. Observe the duplicate keys in the response items array.

Expected behavior
Only distinct keys and labels are returned in the response items array.

Add entity tag header and last modified header to key value result

Describe the bug
The entity tag header and last modified header are missing from the KeyValueResult.

Current behavior
Steps to reproduce the behavior:

  1. Send a request to get a configuration setting.
  2. Observe the missing headers in the response.

Expected behavior
The KeyValueResult should include the entity tag header and the last modified header.

Front-end UI

Is your feature request related to a problem? Please describe.
This is a proposal for adding a front-end UI to this project, to more easily manage configuration settings and feature flags with the local emulator.

Describe the solution you'd like
My current use case involves configuration settings being set in the Azure Portal UI in Configuration Explorer (or the Feature Flags view), including frequently changing their values to test them, so it is a bit burdensome to have to set these manually in the emulator via Postman and such. I'd love to have a front-end UI (probably accessible from the root URL of the app) so that I can easily toggle feature flags and configuration settings.

I think this could be done entirely in JS, with no server-side .NET code needed. It could have a credential/secret input that builds the authentication headers entirely client-side. This also could enable a future enhancement of specifying a target URL, to even use this against a live Azure App Config instance, to verify that it works properly, or even enable other potential use cases around having a local, debuggable remote configuration UI for Azure App Config, or enable sync from Azure App Config to your local emulator.

At a minimum, this should have all the basic Configuration Explorer functionality from the portal, such as creating/updating/deleting config settings with labels, as well as the Feature Manager functionality of creating/editing/deleting and toggling feature flags with labels. My use case also needs administration of feature flag filters (like the targeting filter), but I accept that that could be a separate future enhancement.

Describe alternatives you've considered
Postman, building an internal custom admin UI for my use case

Additional context
I have limited bandwidth at the moment but I could help get this initiative started, if that sounds good to @tnc1997. I would probably default to using the latest Angular/Material on this just because I know it like the back of my hand, but if someone else has different opinions on how it should be done, I can help contribute once they get the architecture started.

Add support for getting historical configuration settings

Is your feature request related to a problem? Please describe.
As a user I would like to get historical configuration setting data.

Describe the solution you'd like
The relevant actions should accept the Accept-Datetime header.

Additional context
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-keys#time-based-access
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#time-based-access
https://learn.microsoft.com/en-us/azure/azure-app-configuration/rest-api-labels#time-based-access

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.