OpaHttpPolicyEngine

class OpaHttpPolicyEngine(config: OpaConfig, httpClient: HttpClient = createDefaultClient()) : OpaPolicyEngine

JVM implementation of OpaPolicyEngine using Ktor HTTP client.

Communicates with an OPA instance over HTTP to evaluate policy requests. Follows the same error handling pattern as CedarlingPdp:

  • Timeout: returns Err with OPA_TIMEOUT code

  • HTTP error: returns Err with OPA_PDP_ERROR code

  • Other errors: returns Err with OPA_ERROR code

Constructors

Link copied to clipboard
constructor(config: OpaConfig, httpClient: HttpClient = createDefaultClient())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val engineType: PolicyEngineType
Link copied to clipboard
open override val id: String

Functions

Link copied to clipboard
open suspend override fun evaluate(request: PolicyRequest): IdkResult<PolicyDecision, IdkError>
Link copied to clipboard
open suspend fun evaluateBatch(requests: List<PolicyRequest>, combineWith: BatchCombineMode): IdkResult<PolicyDecision, IdkError>
Link copied to clipboard
open suspend override fun isHealthy(): Boolean