Skip to content

Opa

Module contains the OPA authorization class that is used to get decisions from the OPA server.

OPAAuthZ

Bases: OPAAuthorization

Applies OPA decisions to HTTP requests for authorization.

Source code in gso/auth/opa.py
class OPAAuthZ(OPAAuthorization):
    """Applies OPA decisions to HTTP requests for authorization."""

    async def get_decision(self, async_request: AsyncClient, opa_input: dict) -> OPAResult:
        """Get the decision from the OPA server."""
        return await _get_decision(self.opa_url, async_request, opa_input)

get_decision(async_request, opa_input) async

Get the decision from the OPA server.

Source code in gso/auth/opa.py
async def get_decision(self, async_request: AsyncClient, opa_input: dict) -> OPAResult:
    """Get the decision from the OPA server."""
    return await _get_decision(self.opa_url, async_request, opa_input)

GraphQLOPAAuthZ

Bases: GraphQLOPAAuthorization

Specializes OPA authorization for GraphQL operations.

Source code in gso/auth/opa.py
class GraphQLOPAAuthZ(GraphQLOPAAuthorization):
    """Specializes OPA authorization for GraphQL operations."""

    async def get_decision(self, async_request: AsyncClient, opa_input: dict) -> OPAResult:
        """Get the decision from the OPA server."""
        return await _get_decision(self.opa_url, async_request, opa_input)

get_decision(async_request, opa_input) async

Get the decision from the OPA server.

Source code in gso/auth/opa.py
async def get_decision(self, async_request: AsyncClient, opa_input: dict) -> OPAResult:
    """Get the decision from the OPA server."""
    return await _get_decision(self.opa_url, async_request, opa_input)