api

package
v0.0.0-...-d5fd275 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package api declares Datly 1.0 components that are the authz SDK endpoints.

Index

Constants

View Source
const Capability = xhandler.ValueKey("authz.sdk")
View Source
const Package = "github.com/viant/authz/datly/api"

Variables

View Source
var Datly = new(Components)

Functions

func Registrations

func Registrations(ctx context.Context, baseDir string, services *Services, codecs xcodec.Factory) ([]*registry.RegisteredComponent, error)

Registrations discovers the declared SDK components using native Datly bootstrap. The host supplies its verifier and narrow authz capabilities. Other projects can use these same components in their own runtime.

Types

type CheckInput

type CheckInput struct {
	JWT       *jwt.Claims     `parameter:"JWT,kind=header,in=Authorization,dataType=string,required=true,errorCode=401" codec:"JwtClaim" json:"-"`
	Resource  authz.Resource  `parameter:"Resource,kind=body,in=resource,required=true" json:"resource"`
	Action    string          `parameter:"Action,kind=body,in=action,required=true" json:"action"`
	Selection *[]authz.Entity `parameter:"Selection,kind=body,in=selection" json:"selection,omitempty"`
}

type Components

type Components struct {
	Check   xdatly.Component[CheckInput, DecisionOutput] `` /* 156-byte string literal not displayed */
	Get     xdatly.Component[PolicyInput, PolicyOutput]  `` /* 145-byte string literal not displayed */
	Create  xdatly.Component[WriteInput, PolicyOutput]   `` /* 157-byte string literal not displayed */
	Replace xdatly.Component[WriteInput, PolicyOutput]   `` /* 161-byte string literal not displayed */
}

func (Components) DatlyHandler

func (Components) DatlyHandler(name string) func() (rhandler.TypedHandler, error)

type DecisionOutput

type DecisionOutput struct {
	Decision authz.Decision `json:"decision"`
}

type PolicyInput

type PolicyInput struct {
	JWT      *jwt.Claims    `parameter:"JWT,kind=header,in=Authorization,dataType=string,required=true,errorCode=401" codec:"JwtClaim" json:"-"`
	Resource authz.Resource `parameter:"Resource,kind=body,in=resource,required=true" json:"resource"`
}

type PolicyOutput

type PolicyOutput struct {
	Document authz.Document `json:"document"`
}

type Services

type Services struct {
	Authorization *authz.Service
	Policies      *authz.Administration
}

type WriteInput

type WriteInput struct {
	JWT      *jwt.Claims    `parameter:"JWT,kind=header,in=Authorization,dataType=string,required=true,errorCode=401" codec:"JwtClaim" json:"-"`
	Document authz.Document `parameter:"Document,kind=body,in=document,required=true" json:"document"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL