Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VisualBean/28a67e692907d1b751d0 to your computer and use it in GitHub Desktop.
Save VisualBean/28a67e692907d1b751d0 to your computer and use it in GitHub Desktop.
public class ApplyBasicAuth : IOperationFilter
{
public string Name { get; private set; }
public ApplyBasicAuth()
{
Name = "basic";
}
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
{
var basicAuthDict = new Dictionary<string, IEnumerable<string>>();
basicAuthDict.Add(Name, new List<string>());
operation.security = new IDictionary<string, IEnumerable<string>>[] {basicAuthDict};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment