Documentation ¶
Index ¶
Constants ¶
const ( DIDHeader = "X-DID" ResourceHeader = "X-Resource" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthResponse ¶
func (AuthResponse) ResponseBytes ¶
func (ar AuthResponse) ResponseBytes() ([]byte, error)
ResponseBytes returns the bytes representation of the base64-encoded Response field.
func (AuthResponse) Validate ¶
func (ar AuthResponse) Validate() error
Validate checks that AuthResponse is valid and does not contains bogus data.
type Challenge ¶
type Challenge struct { Challenge string `json:"challenge"` Timestamp int64 `json:"timestamp"` DID string `json:"did,omitempty"` }
func (Challenge) MarshalBinary ¶
encoding.Binary{Marshaler,Unmarshaler} interface implementation
func (Challenge) SignaturePayload ¶
SignaturePayload returns the bytes on which the user should have placed its signature.
type Config ¶
type Config struct { RedisHost string ProtectedBasePath string ProtectedPaths []ProtectedMapping JWTSecret string CommercioLCD string CacheType CacheType CacheProvider cache }
Config holds data regarding the didcomauth module configuration, such as redis host, Challenge and protected base URL path.
type DidComAuthClaims ¶
type DidComAuthClaims struct { *jwt.StandardClaims Resource string `json:"resource"` DID string `json:"did"` }
DidComAuthClaims represents the JWT claim we release after a successful DID authentication
type ProtectedMapping ¶
type ProtectedMapping struct { Methods []string Path string Handler http.HandlerFunc }
ProtectedMapping represents a URI resource handled under the DID-authenticated protected path.
type ReleaseJWTResponse ¶
type ReleaseJWTResponse struct {
Token string `json:"token"`
}
ReleaseJWTResponse represents a JSON struct which we return to a caller if the DID authentication is successful.