Documentation ¶
Overview ¶
The api package implements the REST API defined in https://github.com/veraison/docs/blob/main/api/challenge-response
Copyright 2022-2023 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2022-2024 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Copyright 2022-2023 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
View Source
const (
ChallengeResponseSessionMediaType = "application/vnd.veraison.challenge-response-session+json"
)
Variables ¶
View Source
var ( ConfigNonceSize uint8 = 32 ConfigSessionTTL, _ = time.ParseDuration("2m30s") )
View Source
var (
ErrInternal = errors.New("internal error")
)
Functions ¶
Types ¶
type ChallengeResponseSession ¶
type ChallengeResponseSession struct { Status Status `json:"status"` Nonce []byte `json:"nonce"` Expiry time.Time `json:"expiry"` Accept []string `json:"accept"` Evidence *EvidenceBlob `json:"evidence,omitempty"` Result *string `json:"result,omitempty"` // contains filtered or unexported fields }
func (*ChallengeResponseSession) SetEvidence ¶
func (o *ChallengeResponseSession) SetEvidence(mt string, evidence []byte)
func (*ChallengeResponseSession) SetResult ¶
func (o *ChallengeResponseSession) SetResult(result []byte)
func (*ChallengeResponseSession) SetStatus ¶
func (o *ChallengeResponseSession) SetStatus(status Status)
type EvidenceBlob ¶
type Handler ¶
type Handler struct { SessionManager sessionmanager.ISessionManager Verifier verifier.IVerifier // contains filtered or unexported fields }
func (*Handler) DelSession ¶
func (*Handler) GetSession ¶
func (*Handler) GetWellKnownVerificationInfo ¶
func (*Handler) NewChallengeResponse ¶
func (*Handler) SubmitEvidence ¶
type IHandler ¶
type IHandler interface { NewChallengeResponse(c *gin.Context) SubmitEvidence(c *gin.Context) GetSession(c *gin.Context) DelSession(c *gin.Context) GetWellKnownVerificationInfo(c *gin.Context) }
func NewHandler ¶
func NewHandler(sm sessionmanager.ISessionManager, v verifier.IVerifier) IHandler
type Status ¶
type Status uint8
func (*Status) FromString ¶
func (Status) MarshalJSON ¶
func (*Status) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.