Injection Provider
The OAuthProvider
class is an interface for the dependency injection definition:
// TypeScriptexport interface OAuthProvider { clientModel(): OAuth2BaseModel; userModel(getUser: GetOAuthUserInteractor, loginUser: LoginOAuthUserInteractor): OAuth2UserModel;}
It exposes two methods, one for obtaining a OAuth2BaseModel
and a OAuth2UserModel
.
Currently, there is only one implementation of that provider (described below), but new implementations can be provided if required.
1. OAuthSQLProvider
An SQL based implementation of the OAuthProvider
.
// TypeScriptexport class OAuthSqlProvider implements OAuthProvider { constructor( private readonly sqlInterface: SQLInterface, ) {}
public clientModel... public userModel...}
Required on its constructor, there is a SQLInterface
, which is going to be the entry point to the SQL database.
Also, the database must conform to the SQL Schema defined in: