Issue Principal Token
Motivation
Issue (create) a new principal token in exchange for valid credentials.
Functional Design
POST /api/v2/apps/{owner}/{app}/auth/login
Headers
Content-Type
application/json
Parameters
owner
string
name of a user who owns the application
app
string
name of an application
Body
JSON object:
{
"login": "login",
"password": "password"
}Result
200
OK
Returns an access token, see below
Example result 200:
{
"principalToken": "abc.def.ghi",
"expiresInSeconds": 3600, // seconds
"profileWSID": 1234567890
}Technical design
Components
pkg/router
URL path handler
~cmp.routerLoginPathHandler~✅:reads Login and Password from the Body;
sends
APIPath_Auth_Loginrequest to QueryProcessor;
pkg/processors/query2
IApiPathHandlerimplementation for handlingAPIPath_Auth_Login~cmp.authLoginHandler~✅using login from the argument, generates pseudo-WSID
makes federation post to registry to issue a token
newQueryProcessorPipeline: provide API handler forAPIPath_Auth_Login~cmp.provideAuthLoginHandler~✅
openapi:
add
/auth/loginto the list of API paths;~cmp.provideAuthLoginPath~✅add PrincipalToken component schema;
~cmp.principalTokenSchema~✅
pkg/sys/it
integration test for /login
~it.TestLogin~✅
Last updated
Was this helpful?