Alexa Auto SDK  4.3
Public Types | Public Member Functions | List of all members
aace::authorization::Authorization Class Referenceabstract

Public Types

using AuthorizationState = aace::authorization::AuthorizationEngineInterface::AuthorizationState
 Describes the authorization states.
 

Public Member Functions

virtual void eventReceived (const std::string &service, const std::string &event)=0
 
virtual void authorizationStateChanged (const std::string &service, AuthorizationState state)=0
 
virtual void authorizationError (const std::string &service, const std::string &error, const std::string &message)=0
 
virtual std::string getAuthorizationData (const std::string &service, const std::string &key)=0
 
virtual void setAuthorizationData (const std::string &service, const std::string &key, const std::string &data)=0
 
void startAuthorization (const std::string &service, const std::string &data)
 
void cancelAuthorization (const std::string &service)
 
void sendEvent (const std::string &service, const std::string &event)
 
void logout (const std::string &service)
 
virtual ~Authorization ()
 

Detailed Description

The Authorization class should be extended to carry out the authorizations required for the Engine.

This class serves as a single platform interface for all the authorization services supported by the Engine, (such as CBL). The platform implementation must use the platform interface to interact with the service and follows the protocol established by the service to authorize a device. For information about the protocol, see the README file appropriate to the authorization service. For example, see the README in the CBL module to see how the Authorization platform interface works with CBL.

Deprecated:
This platform interface is deprecated. Use the Alexa Auto Services Bridge (AASB) message broker to publish and subscribe to AASB messages instead.
See also
aace::core::MessageBroker

Constructor & Destructor Documentation

◆ ~Authorization()

aace::authorization::Authorization::~Authorization ( )
virtualdefault

Destructor

Member Function Documentation

◆ eventReceived()

virtual void aace::authorization::Authorization::eventReceived ( const std::string &  service,
const std::string &  event 
)
pure virtual

Notifies the platform implementation about the authorization event.

Parameters
serviceIndicates the authorization service.
eventJSON representation of the authorization event as defined by the authorization service.

◆ authorizationStateChanged()

virtual void aace::authorization::Authorization::authorizationStateChanged ( const std::string &  service,
AuthorizationState  state 
)
pure virtual

Notifies the platform implementation about a change in authorization state.

Parameters
serviceIndicates the authorization service.
stateThe authorization state represented using AuthorizationState

◆ authorizationError()

virtual void aace::authorization::Authorization::authorizationError ( const std::string &  service,
const std::string &  error,
const std::string &  message 
)
pure virtual

Notifies the platform implementation about any error in the authorization process.

Parameters
serviceIndicates the authorization service.
errorIndicates the type of authorization error. The possible types are defined by each authorization service.
messageError message for logging purposes.

◆ getAuthorizationData()

virtual std::string aace::authorization::Authorization::getAuthorizationData ( const std::string &  service,
const std::string &  key 
)
pure virtual

Retrieves the authorization data from the platform implementation.

Note
A call to this API does not always necessitate a corresponding call to setAuthorizationData.
Parameters
serviceIndicates the authorization service.
keyThe key of the data requested.
Returns
Returns the value of the key if available. Otherwise, returns an empty string.

◆ setAuthorizationData()

virtual void aace::authorization::Authorization::setAuthorizationData ( const std::string &  service,
const std::string &  key,
const std::string &  data 
)
pure virtual

Notifies the platform implementation to store the authorization data.

Note
It is the responsibility of the platform implementation to securely store the data.
Parameters
serviceIndicates the authorization service.
keyRepresents the key of the data
dataRepresents the data to be stored.

◆ startAuthorization()

void aace::authorization::Authorization::startAuthorization ( const std::string &  service,
const std::string &  data 
)

Notifies the Engine to start the authorization process. Engine to call authorizationStateChanged with AUTHORIZING on the start of authorization process. Engine to call authorizationStateChanged with AUTHORIZED on the successful authorization.

Parameters
serviceIndicates the authorization service.
dataRepresents the data in JSON format. The content of the JSON object is defined by each authorization service.

◆ cancelAuthorization()

void aace::authorization::Authorization::cancelAuthorization ( const std::string &  service)

Notifies the Engine to cancel the authorization process.

Note
The call does not log out the active authorization.
Parameters
serviceIndicates the authorization service.

◆ sendEvent()

void aace::authorization::Authorization::sendEvent ( const std::string &  service,
const std::string &  event 
)

Notifies the Engine of the authorization event from the platform implementation.

Parameters
serviceIndicates the authorization service.
eventRepresents the event in JSON format. The content of the JSON object is defined by each authorization service.

◆ logout()

void aace::authorization::Authorization::logout ( const std::string &  service)

Notifies the Engine to log out of an authorization. Engine calls authorizationStateChanged with UNAUTHORIZED on the successful logout.

Parameters
serviceIndicates the authorization service of which the Engine will log out.

Alexa Auto SDK 4.3 - Copyright 2017-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0