Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` }
AccessToken holds the response access token
type Claims ¶
type Claims struct {
*jwt.StandardClaims
}
Claims is a wrapper around JWT Standard claims, if the spec changes this is a convient way to implement custom claims.
type Client ¶
type Client interface { GenerateJWTToken() (string, error) AccessRequest() (*AccessToken, error) }
Client is the interface for this client library.
func NewClient ¶
func NewClient(config *ClientConfig) (Client, error)
NewClient returns a new iShare client, it loads and parses the iShare certificate files. It returns an error when the certificates can not be found or your private key password is incorrect.
type ClientConfig ¶
type ClientConfig struct { EORI string // Client EORI COC string // Clients COC PublicKeyPath string // path to public key file (myisharecertificate.cert.pem) PrivateKeyPath string // Path to private key file (myishareprivate.key.pem) PrivateKeyPassword []byte // Private key password EORIRegistry string // EORI Registry AccessRequestUrl string // Holds the URL of the authorization registry StripCertificate bool // Strip the -----BEGIN CERTIFICATE----- and -----END CERTIIFCATE---- from your the certificate }
ClientConfig holds the configuration to start the authorization process.
Click to show internal directories.
Click to hide internal directories.