Table of Contents

Class OpaResponseContext

Namespace
Styra.Opa.AspNetCore
Assembly
Styra.Opa.AspNetCore.dll
public class OpaResponseContext
Inheritance
OpaResponseContext
Inherited Members

Fields

Data

[JsonProperty("data")]
public Dictionary<string, object>? Data

Field Value

Dictionary<string, object>

ID

[JsonProperty("id")]
public string? ID

Field Value

string

ReasonAdmin

[JsonProperty("reason_admin")]
public Dictionary<string, string>? ReasonAdmin

Field Value

Dictionary<string, string>

ReasonUser

[JsonProperty("reason_user")]
public Dictionary<string, string>? ReasonUser

Field Value

Dictionary<string, string>

Methods

GetReasonForDecision(string)

This method selects an appropriate reason to use for creating ASP.NET Core authorization decisions. Currently, it will select the search key if it is present in the reason_user object, and if not it will select the key which sorts first from reason_user. It will not consider data in reason_admin.

public string? GetReasonForDecision(string searchKey)

Parameters

searchKey string

Returns

string