verifier

package
v0.0.0-...-ef5c1ef Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Copyright 2023 Jesus Ruiz. All rights reserved. Use of this source code is governed by an Apache 2.0 license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(s *handlers.Server, cfg *yaml.YAML)

Setup creates and setups the Verifier routes

func StarDictFromFiberRequest

func StarDictFromFiberRequest(c *fiber.Ctx) *starlark.Dict

func StarDictFromHttpRequest

func StarDictFromHttpRequest(request *http.Request) (*starlark.Dict, error)

Types

type Decision

type Decision int

Decision can be Authenticate or Authorize

const Authenticate Decision = 1
const Authorize Decision = 2

func (Decision) String

func (d Decision) String() string

type PDP

type PDP struct {
	// contains filtered or unexported fields
}

PDP implements a simple Policy Decision Point in Starlark

func NewPDP

func NewPDP(fileName string) (*PDP, error)

func (PDP) HttpHandler

func (m PDP) HttpHandler(w http.ResponseWriter, r *http.Request)

func (*PDP) ParseAndCompileFile

func (m *PDP) ParseAndCompileFile() error

ParseAndCompileFile reads a file with Starlark code and compiles it, storing the resulting global dictionary for later usage. In particular, the compiled module should define two functions, one for athentication and the second for athorisation. ParseAndCompileFile can be called several times and will perform a new compilation every time, creating a new Thread and so the old ones will never be called again and eventually will be disposed.

func (PDP) TakeAuthnDecision

func (m PDP) TakeAuthnDecision(decision Decision, c *fiber.Ctx, credential string, protectedResource string) bool

TakeAuthnDecision is called when a decision should be taken for either Athentication or Authorization. The type of decision to evaluate is passed in the Decision argument. The rest of the arguments contain the information required for the decision. They are: - the Verifiable Credential with the information from the caller needed for the decision - the protected resource that the caller identified in the Credential wants to access

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func (*Verifier) APIInternalPoll

func (v *Verifier) APIInternalPoll(c *fiber.Ctx) error

func (*Verifier) APIWalletAuthenticationRequest

func (v *Verifier) APIWalletAuthenticationRequest(c *fiber.Ctx) error

func (*Verifier) APIWalletAuthenticationResponse

func (v *Verifier) APIWalletAuthenticationResponse(c *fiber.Ctx) error

func (*Verifier) HandleVerifierHome

func (v *Verifier) HandleVerifierHome(c *fiber.Ctx) error

func (*Verifier) PageAccessProtectedService

func (v *Verifier) PageAccessProtectedService(c *fiber.Ctx) error

PageAccessProtectedService performs access control to a protected resource based on the access token. For the moment is just a simulation

func (*Verifier) PageDisplaySimpleQR

func (v *Verifier) PageDisplaySimpleQR(c *fiber.Ctx) error

func (*Verifier) PageLoginCompleted

func (v *Verifier) PageLoginCompleted(c *fiber.Ctx) error

PageLoginCompleted is invoked by the page presenting the QR for authentication, when this page detects that the Wallet has sent a Verifiable Credential and WebAuthn is also completed.

func (*Verifier) PageLoginDenied

func (v *Verifier) PageLoginDenied(c *fiber.Ctx) error

PageLoginDenied is invoked by the page presenting the QR for authentication, when this page detects that the Wallet has sent a Verifiable Credential and WebAuthn is also completed.

func (*Verifier) PageLoginExpired

func (v *Verifier) PageLoginExpired(c *fiber.Ctx) error

Serve /loginexpired route

func (*Verifier) PageReceiveCredential

func (v *Verifier) PageReceiveCredential(c *fiber.Ctx) error

PageReceiveCredential is invoked by the page presenting the QR for authentication, when this page detects that the Wallet has sent a Verifiable Credential.

func (*Verifier) VerifierAPIJWKS

func (v *Verifier) VerifierAPIJWKS(c *fiber.Ctx) error

Jump to

Keyboard shortcuts

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