user model already has auth related fields: Password, Token, RoleId, TenantId, LastLogin and LastPasswordChange but they need to be added to user protobuf.
TODOs:
Within services, the Server struct need to have additional data fields: an RBACService, a Securer and an AuthService:
type AuthService interface {
GetUser(context.Context) *model.AuthUser
}
Requests authorization need to be implemented in there.
Please contact @blushi to discuss specifications.
Prerequisites:
The user-api has currently no authentication/authorization implemented.
The tools to implement that are already there:
Regarding the models, there are already:
role
with 4 predefined rolestenant
user
model already has auth related fields:Password
,Token
,RoleId
,TenantId
,LastLogin
andLastPasswordChange
but they need to be added to user protobuf.TODOs:
Server
struct need to have additional data fields: anRBACService
, aSecurer
and anAuthService
:Requests authorization need to be implemented in there. Please contact @blushi to discuss specifications.
Some inspiration from the Twisk project.
Database migration:
Adapt
cmd/api/main.go
Don't forget about tests!