Documentation ¶
Overview ¶
The authorization functional block contains OCPP 2.0 authorization-related features. It contains different ways of authorizing a user, online and/or offline .
Index ¶
Constants ¶
const AuthorizeFeatureName = "Authorize"
const ClearCacheFeatureName = "ClearCache"
const ProfileName = "authorization"
Variables ¶
var Profile = ocpp.NewProfile( ProfileName, AuthorizeFeature{}, ClearCacheFeature{}, )
Functions ¶
This section is empty.
Types ¶
type AuthorizeCertificateStatus ¶
type AuthorizeCertificateStatus string
The Certificate status information.
const ( CertificateStatusAccepted AuthorizeCertificateStatus = "Accepted" CertificateStatusSignatureError AuthorizeCertificateStatus = "SignatureError" CertificateStatusCertificateExpired AuthorizeCertificateStatus = "CertificateExpired" CertificateStatusCertificateRevoked AuthorizeCertificateStatus = "CertificateRevoked" CertificateStatusNoCertificateAvailable AuthorizeCertificateStatus = "NoCertificateAvailable" CertificateStatusCertChainError AuthorizeCertificateStatus = "CertChainError" CertificateStatusContractCancelled AuthorizeCertificateStatus = "ContractCancelled" )
type AuthorizeFeature ¶
type AuthorizeFeature struct{}
Before the owner of an electric vehicle can start or stop charging, the Charging Station has to authorize the operation. Upon receipt of an AuthorizeRequest, the CSMS SHALL respond with an AuthorizeResponse. This response payload SHALL indicate whether or not the idTag is accepted by the CSMS. If the CSMS accepts the idToken then the response payload MUST include an authorization status value indicating acceptance or a reason for rejection.
A Charging Station MAY authorize identifier locally without involving the CSMS, as described in Local Authorization List.
The Charging Station SHALL only supply energy after authorization.
func (AuthorizeFeature) GetFeatureName ¶
func (f AuthorizeFeature) GetFeatureName() string
func (AuthorizeFeature) GetRequestType ¶
func (f AuthorizeFeature) GetRequestType() reflect.Type
func (AuthorizeFeature) GetResponseType ¶
func (f AuthorizeFeature) GetResponseType() reflect.Type
type AuthorizeRequest ¶
type AuthorizeRequest struct { Certificate string `json:"certificate,omitempty" validate:"max=5500"` IdToken types.IdToken `json:"idToken" validate:"required"` CertificateHashData []types.OCSPRequestDataType `json:"iso15118CertificateHashData,omitempty" validate:"max=4,dive"` }
The field definition of the Authorize request payload sent by the Charging Station to the CSMS.
func NewAuthorizationRequest ¶
func NewAuthorizationRequest(idToken string, tokenType types.IdTokenType) *AuthorizeRequest
Creates a new AuthorizeRequest, containing all required fields. There are no optional fields for this message.
func (AuthorizeRequest) GetFeatureName ¶
func (r AuthorizeRequest) GetFeatureName() string
type AuthorizeResponse ¶
type AuthorizeResponse struct { CertificateStatus AuthorizeCertificateStatus `json:"certificateStatus,omitempty" validate:"omitempty,authorizeCertificateStatus"` IdTokenInfo types.IdTokenInfo `json:"idTokenInfo" validate:"required"` }
This field definition of the Authorize response payload, sent by the Charging Station to the CSMS in response to an AuthorizeRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewAuthorizationResponse ¶
func NewAuthorizationResponse(idTokenInfo types.IdTokenInfo) *AuthorizeResponse
Creates a new AuthorizeResponse. There are no optional fields for this message.
func (AuthorizeResponse) GetFeatureName ¶
func (c AuthorizeResponse) GetFeatureName() string
type CSMSHandler ¶
type CSMSHandler interface { // OnAuthorize is called on the CSMS whenever an AuthorizeRequest is received from a charging station. OnAuthorize(chargingStationID string, request *AuthorizeRequest) (confirmation *AuthorizeResponse, err error) }
Needs to be implemented by a CSMS for handling messages part of the OCPP 2.0 Authorization profile.
type ChargingStationHandler ¶
type ChargingStationHandler interface { // OnClearCache is called on a charging station whenever a ClearCacheRequest is received from the CSMS. OnClearCache(request *ClearCacheRequest) (confirmation *ClearCacheResponse, err error) }
Needs to be implemented by Charging stations for handling messages part of the OCPP 2.0 Authorization profile.
type ClearCacheFeature ¶
type ClearCacheFeature struct{}
CSMS can request a Charging Station to clear its Authorization Cache. The CSMS SHALL send a ClearCacheRequest payload for clearing the Charging Station’s Authorization Cache. Upon receipt of a ClearCacheRequest, the Charging Station SHALL respond with a ClearCacheResponse payload. The response payload SHALL indicate whether the Charging Station was able to clear its Authorization Cache.
func (ClearCacheFeature) GetFeatureName ¶
func (f ClearCacheFeature) GetFeatureName() string
func (ClearCacheFeature) GetRequestType ¶
func (f ClearCacheFeature) GetRequestType() reflect.Type
func (ClearCacheFeature) GetResponseType ¶
func (f ClearCacheFeature) GetResponseType() reflect.Type
type ClearCacheRequest ¶
type ClearCacheRequest struct { }
The field definition of the ClearCache request payload sent by the CSMS to the Charging Station.
func NewClearCacheRequest ¶
func NewClearCacheRequest() *ClearCacheRequest
Creates a new ClearCacheRequest, which doesn't contain any required or optional fields.
func (ClearCacheRequest) GetFeatureName ¶
func (r ClearCacheRequest) GetFeatureName() string
type ClearCacheResponse ¶
type ClearCacheResponse struct { Status ClearCacheStatus `json:"status" validate:"required,cacheStatus201"` StatusInfo *types.StatusInfo `json:"statusInfo,omitempty" validate:"omitempty"` }
This field definition of the ClearCache response payload, sent by the Charging Station to the CSMS in response to a ClearCacheRequest. In case the request was invalid, or couldn't be processed, an error will be sent instead.
func NewClearCacheResponse ¶
func NewClearCacheResponse(status ClearCacheStatus) *ClearCacheResponse
Creates a new ClearCacheResponse, containing all required fields. There are no optional fields for this message.
func (ClearCacheResponse) GetFeatureName ¶
func (c ClearCacheResponse) GetFeatureName() string
type ClearCacheStatus ¶
type ClearCacheStatus string
Status returned in response to ClearCacheRequest.
const ( ClearCacheStatusAccepted ClearCacheStatus = "Accepted" ClearCacheStatusRejected ClearCacheStatus = "Rejected" )