authorization

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 0

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

View Source
const AuthorizeFeatureName = "Authorize"
View Source
const ClearCacheFeatureName = "ClearCache"
View Source
const ProfileName = "authorization"

Variables

Functions

This section is empty.

Types

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 {
	EvseID              []int                       `json:"evseId,omitempty"`
	IdToken             types.IdToken               `json:"idToken" validate:"required"`
	CertificateHashData []types.OCSPRequestDataType `json:"15118CertificateHashData,omitempty" validate:"max=4"`
}

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 types.CertificateStatus `json:"certificateStatus,omitempty" validate:"omitempty,certificateStatus"`
	EvseID            []int                   `json:"evseId,omitempty"`
	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,cacheStatus"`
}

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"
)

Jump to

Keyboard shortcuts

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