Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
949 stars 197 forks source link

[Enhancement]: Simulate Claims in Development #2367

Open JerryNixon opened 2 months ago

JerryNixon commented 2 months ago

What is it?

Currently, using Simulator grants the default role authenticated, but doesn't allow injecting claims for policy testing. This enhancement introduces simulator-claims, letting developers test claims-based logic locally.

Configuration Example

{
  "authentication": {
    "provider": "Simulator",
    "simulator-claims": {
      "roles": ["admin"],
      "groups": ["dev-team"],
      "custom_claims": {
        "region": "US",
        "accessLevel": "developer"
      }
    }
  }
}

This lets developers test scenarios based on simulated roles and claims without needing Azure Entra ID.

Environment-Specific Config

To prevent accidental deployment of simulated claims to production, use environment-specific configuration files (e.g., appsettings.Development.json). This allows developers to safely use simulator-claims during development while keeping production configuration clean.

Benefits

Related Issues to Close