Documentation ¶
Overview ¶
Package asmodel ...
Package asmodel ...
Package asmodel ...
Package asmodel ...
Package asmodel ...
Index ¶
- Variables
- func CreateUser(user User) *errors.Error
- func DeleteUser(key string) *errors.Error
- func GetAllSessionKeys() ([]string, *errors.Error)
- func UpdateUserDetails(user, newData User) *errors.Error
- type Account
- type CreateSession
- type OEMPrivileges
- type Privileges
- type RedfishRoles
- type Role
- type Session
- type User
Constants ¶
This section is empty.
Variables ¶
var (
GetDBConnectionFunc = common.GetDBConnection
)
Functions ¶
func CreateUser ¶
CreateUser connects to the persistencemgr and creates a user in db
func DeleteUser ¶
DeleteUser will delete the user entry from the database based on the uuid
func GetAllSessionKeys ¶
GetAllSessionKeys will collect all session keys available in the DB
func UpdateUserDetails ¶
UpdateUserDetails will modify the current details to given changes
Types ¶
type Account ¶
type Account struct { UserName string `json:"UserName"` Password string `json:"Password"` RoleID string `json:"RoleId"` }
Account is the model for creating/updating an Account
type CreateSession ¶
CreateSession will hold input request for creating a session
type OEMPrivileges ¶
type OEMPrivileges struct {
List []string
}
OEMPrivileges struct definition
func GetOEMPrivileges ¶
func GetOEMPrivileges() (OEMPrivileges, *errors.Error)
GetOEMPrivileges retrives the privileges from database
func (*OEMPrivileges) Create ¶
func (p *OEMPrivileges) Create() *errors.Error
Create method is to insert the oemprivileges list to database
type Privileges ¶
type Privileges struct {
List []string
}
Privileges struct definition
func GetPrivilegeRegistry ¶
func GetPrivilegeRegistry() (Privileges, *errors.Error)
GetPrivilegeRegistry retrives the privileges from database
func (*Privileges) Create ¶
func (p *Privileges) Create() *errors.Error
Create method is to insert the privileges list to database
type RedfishRoles ¶
type RedfishRoles struct {
List []string
}
RedfishRoles struct definition
func GetRedfishRoles ¶
func GetRedfishRoles() (RedfishRoles, *errors.Error)
GetRedfishRoles retrives the privileges from database
func (*RedfishRoles) Create ¶
func (r *RedfishRoles) Create() *errors.Error
Create method is to insert the privileges list to database
type Role ¶
type Role struct { ID string `json:"RoleId"` IsPredefined bool `json:"IsPredefined"` AssignedPrivileges []string `json:"AssignedPrivileges"` OEMPrivileges []string `json:"OemPrivileges"` }
Role struct definition
func GetAllRoles ¶
GetAllRoles gets all the roles from the db
func GetRoleDetailsByID ¶
GetRoleDetailsByID retrives the privileges for a role from database
func (*Role) UpdateRoleDetails ¶
UpdateRoleDetails will modify the current details to given changes
type Session ¶
type Session struct { ID string Token string UserName string RoleID string Privileges map[string]bool Origin string CreatedTime time.Time LastUsedTime time.Time }
Session will hold the data assosiated with the session
func GetSession ¶
GetSession will get the session details from db if available