ishare

package
v0.0.0-...-702c227 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ArDelegationPathVar = "ISHARE_DELEGATION_PATH"
View Source
const ArTokenPathVar = "ISHARE_TOKEN_PATH"
View Source
const AuthorizationRegistryIdVar = "ISHARE_AR_ID"
View Source
const AuthorizationRegistryUrlVar = "ISHARE_AUTHORIZATION_REGISTRY_URL"
View Source
const CertificatePathVar = "ISHARE_CERTIFICATE_PATH"
View Source
const FingerprintsListEnvVar = "ISHARE_TRUSTED_FINGERPRINTS_LIST"
View Source
const IShareClientIdVar = "ISHARE_CLIENT_ID"
View Source
const IShareEnabledVar = "ISHARE_ENABLED"
View Source
const KeyPathVar = "ISHARE_KEY_PATH"
View Source
const SatellitUrlEnvVar = "ISHARE_TRUST_ANCHOR_URL"
View Source
const SatelliteIdEnvVar = "ISHARE_TRUST_ANCHOR_ID"
View Source
const SatelliteTokenPathEnvVar = "ISHARE_TRUST_ANCHOR_TOKEN_PATH"
View Source
const SatelliteTrustedListPathEnvVar = "ISHARE_TRUST_ANCHOR_TRUSTED_LIST_PATH"
View Source
const TrustedListUpdateRateEnvVar = "ISHARE_TRUSTED_LIST_UPDATE_RATE"

Variables

This section is empty.

Functions

func CheckDelegationEvidence

func CheckDelegationEvidence(delegationEvidence *model.DelegationEvidence) (decision model.Decision)

Types

type AuthorizationRegistry

type AuthorizationRegistry interface {
	GetPDPRegistry() *model.AuthorizationRegistry
	GetDelegationEvidence(issuer string, delegationTarget string, requiredPolicies *[]model.Policy, authorizationRegistry *model.AuthorizationRegistry) (delegeationEvidence *model.DelegationEvidence, httpErr model.HttpError)
}

type Clock

type Clock interface {
	Now() time.Time
}

type IShareAuthorizationRegistry

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

func NewIShareAuthorizationRegistry

func NewIShareAuthorizationRegistry() (registry *IShareAuthorizationRegistry)

* * Init reades and decodes the key and certificate to be used when contacting the AR

func (*IShareAuthorizationRegistry) GetDelegationEvidence

func (iShareAuthRegistry *IShareAuthorizationRegistry) GetDelegationEvidence(issuer string, delegationTarget string, requiredPolicies *[]model.Policy, authorizationRegistry *model.AuthorizationRegistry) (delegeationEvidence *model.DelegationEvidence, httpErr model.HttpError)

func (*IShareAuthorizationRegistry) GetPDPRegistry

func (iShareAuthRegistry *IShareAuthorizationRegistry) GetPDPRegistry() *model.AuthorizationRegistry

type IShareDecider

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

func NewIShareDecider

func NewIShareDecider(ar AuthorizationRegistry, config config.Config) *IShareDecider

func (IShareDecider) Decide

func (isd IShareDecider) Decide(verifiableCredential *model.DSBAVerifiableCredential, originalAddress string, requestType string, requestBody *map[string]interface{}) (decision model.Decision, httpErr model.HttpError)

type IShareTrustedParticipantRepository

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

func NewTrustedParticipantRepository

func NewTrustedParticipantRepository(tokenFunc TokenFunc, trustedListParserFunc TrustedListParseFunc, partyParseFunc PartyParseFunc) *IShareTrustedParticipantRepository

func (IShareTrustedParticipantRepository) IsTrusted

func (icr IShareTrustedParticipantRepository) IsTrusted(caCertificate *x509.Certificate, clientCertificate *x509.Certificate, clientId string) (isTrusted bool)

type PartyParseFunc

type PartyParseFunc func(string) (*model.PartyToken, model.HttpError)

type RealClock

type RealClock struct{}

func (RealClock) Now

func (c RealClock) Now() time.Time

type TokenFunc

type TokenFunc func(*model.AuthorizationRegistry) (string, model.HttpError)

type TokenHandler

type TokenHandler struct {

	/**
	* Clock interface for validating tokens
	 */
	Clock Clock
	// contains filtered or unexported fields
}

func NewTokenHandler

func NewTokenHandler() (tokenHandler *TokenHandler)

func (*TokenHandler) GenerateSignedToken

func (tokenHandler *TokenHandler) GenerateSignedToken(arId string, clientId string) (signedToken string, err error)

func (*TokenHandler) GetKeyFromToken

func (th *TokenHandler) GetKeyFromToken(token *jwt.Token) (key *rsa.PublicKey, err error)

func (*TokenHandler) GetTokenFromAR

func (tokenHandler *TokenHandler) GetTokenFromAR(authorizationRegistry *model.AuthorizationRegistry) (accessToken string, httpErr model.HttpError)

func (*TokenHandler) ParseIShareToken

func (th *TokenHandler) ParseIShareToken(tokenString string) (parsedToken *model.IShareToken, httpErr model.HttpError)

func (*TokenHandler) ParsePartyToken

func (th *TokenHandler) ParsePartyToken(tokenString string) (parsedToken *model.PartyToken, httpErr model.HttpError)

func (*TokenHandler) ParseTrustedListToken

func (th *TokenHandler) ParseTrustedListToken(tokenString string) (parsedToken *model.TrustedListToken, httpErr model.HttpError)

type TrustedListParseFunc

type TrustedListParseFunc func(string) (*model.TrustedListToken, model.HttpError)

type TrustedParticipantRepository

type TrustedParticipantRepository interface {
	IsTrusted(caCertificate *x509.Certificate, clientCertificate *x509.Certificate, clientId string) (isTrusted bool)
}

Jump to

Keyboard shortcuts

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