identity

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessCheckRequest

type AccessCheckRequest struct {
	UserSysID   string `json:"user_sys_id"`
	Table       string `json:"table"`
	Operation   string `json:"operation"` // read, write, create, delete
	RecordSysID string `json:"record_sys_id,omitempty"`
}

AccessCheckRequest contains parameters for access control checks

type AccessCheckResult

type AccessCheckResult struct {
	HasAccess     bool     `json:"has_access"`
	Reason        string   `json:"reason,omitempty"`
	RequiredRoles []string `json:"required_roles,omitempty"`
	GrantedBy     string   `json:"granted_by,omitempty"`
}

AccessCheckResult contains the result of an access control check

type AccessClient

type AccessClient struct {
	// contains filtered or unexported fields
}

AccessClient handles access control and session management operations

func (*AccessClient) CheckAccess

func (a *AccessClient) CheckAccess(request *AccessCheckRequest) (*AccessCheckResult, error)

CheckAccess checks if a user has access to perform an operation on a table/record

func (*AccessClient) CheckAccessWithContext

func (a *AccessClient) CheckAccessWithContext(ctx context.Context, request *AccessCheckRequest) (*AccessCheckResult, error)

CheckAccessWithContext checks access with context support

func (*AccessClient) DeleteUserPreference

func (a *AccessClient) DeleteUserPreference(userSysID, name string) error

DeleteUserPreference removes a user preference

func (*AccessClient) DeleteUserPreferenceWithContext

func (a *AccessClient) DeleteUserPreferenceWithContext(ctx context.Context, userSysID, name string) error

DeleteUserPreferenceWithContext removes a user preference with context support

func (*AccessClient) GetActiveSessions

func (a *AccessClient) GetActiveSessions() ([]*UserSession, error)

GetActiveSessions retrieves active user sessions

func (*AccessClient) GetActiveSessionsWithContext

func (a *AccessClient) GetActiveSessionsWithContext(ctx context.Context) ([]*UserSession, error)

GetActiveSessionsWithContext retrieves active sessions with context support

func (*AccessClient) GetUserPermissions

func (a *AccessClient) GetUserPermissions(userSysID string) (map[string][]string, error)

GetUserPermissions retrieves all effective permissions for a user

func (*AccessClient) GetUserPermissionsWithContext

func (a *AccessClient) GetUserPermissionsWithContext(ctx context.Context, userSysID string) (map[string][]string, error)

GetUserPermissionsWithContext retrieves user permissions with context support

func (*AccessClient) GetUserPreferences

func (a *AccessClient) GetUserPreferences(userSysID string) ([]*UserPreference, error)

GetUserPreferences retrieves preferences for a user

func (*AccessClient) GetUserPreferencesWithContext

func (a *AccessClient) GetUserPreferencesWithContext(ctx context.Context, userSysID string) ([]*UserPreference, error)

GetUserPreferencesWithContext retrieves user preferences with context support

func (*AccessClient) GetUserSessions

func (a *AccessClient) GetUserSessions(userSysID string) ([]*UserSession, error)

GetUserSessions retrieves sessions for a specific user

func (*AccessClient) GetUserSessionsWithContext

func (a *AccessClient) GetUserSessionsWithContext(ctx context.Context, userSysID string) ([]*UserSession, error)

GetUserSessionsWithContext retrieves user sessions with context support

func (*AccessClient) InvalidateUserSessions

func (a *AccessClient) InvalidateUserSessions(userSysID string) error

InvalidateUserSessions invalidates all active sessions for a user

func (*AccessClient) InvalidateUserSessionsWithContext

func (a *AccessClient) InvalidateUserSessionsWithContext(ctx context.Context, userSysID string) error

InvalidateUserSessionsWithContext invalidates user sessions with context support

func (*AccessClient) SetUserPreference

func (a *AccessClient) SetUserPreference(userSysID, name, value string) (*UserPreference, error)

SetUserPreference sets a preference for a user

func (*AccessClient) SetUserPreferenceWithContext

func (a *AccessClient) SetUserPreferenceWithContext(ctx context.Context, userSysID, name, value string) (*UserPreference, error)

SetUserPreferenceWithContext sets a user preference with context support

type Group

type Group struct {
	SysID           string                 `json:"sys_id"`
	Name            string                 `json:"name"`
	Description     string                 `json:"description"`
	Type            string                 `json:"type"`
	Active          bool                   `json:"active"`
	Email           string                 `json:"email"`
	Parent          string                 `json:"parent"`
	Manager         string                 `json:"manager"`
	CostCenter      string                 `json:"cost_center"`
	DefaultAssignee string                 `json:"default_assignee"`
	IncludeMembers  bool                   `json:"include_members"`
	Points          int                    `json:"points"`
	Source          string                 `json:"source"`
	Members         []string               `json:"members,omitempty"`
	Roles           []string               `json:"roles,omitempty"`
	Attributes      map[string]interface{} `json:"attributes,omitempty"`
	CreatedBy       string                 `json:"sys_created_by"`
	CreatedOn       time.Time              `json:"sys_created_on"`
	UpdatedBy       string                 `json:"sys_updated_by"`
	UpdatedOn       time.Time              `json:"sys_updated_on"`
}

Group represents a ServiceNow group

type GroupClient

type GroupClient struct {
	// contains filtered or unexported fields
}

GroupClient handles group management operations

func (*GroupClient) AddUserToGroup

func (g *GroupClient) AddUserToGroup(userSysID, groupSysID string) (*GroupMember, error)

AddUserToGroup adds a user to a group

func (*GroupClient) AddUserToGroupWithContext

func (g *GroupClient) AddUserToGroupWithContext(ctx context.Context, userSysID, groupSysID string) (*GroupMember, error)

AddUserToGroupWithContext adds a user to a group with context support

func (*GroupClient) BulkAddUsersToGroup

func (g *GroupClient) BulkAddUsersToGroup(userSysIDs []string, groupSysID string) ([]*GroupMember, error)

BulkAddUsersToGroup adds multiple users to a group in one operation

func (*GroupClient) BulkAddUsersToGroupWithContext

func (g *GroupClient) BulkAddUsersToGroupWithContext(ctx context.Context, userSysIDs []string, groupSysID string) ([]*GroupMember, error)

BulkAddUsersToGroupWithContext adds multiple users to a group with context support

func (*GroupClient) BulkRemoveUsersFromGroup

func (g *GroupClient) BulkRemoveUsersFromGroup(userSysIDs []string, groupSysID string) error

BulkRemoveUsersFromGroup removes multiple users from a group

func (*GroupClient) BulkRemoveUsersFromGroupWithContext

func (g *GroupClient) BulkRemoveUsersFromGroupWithContext(ctx context.Context, userSysIDs []string, groupSysID string) error

BulkRemoveUsersFromGroupWithContext removes multiple users from a group with context support

func (*GroupClient) CreateGroup

func (g *GroupClient) CreateGroup(groupData map[string]interface{}) (*Group, error)

CreateGroup creates a new group

func (*GroupClient) CreateGroupWithContext

func (g *GroupClient) CreateGroupWithContext(ctx context.Context, groupData map[string]interface{}) (*Group, error)

CreateGroupWithContext creates a new group with context support

func (*GroupClient) DeleteGroup

func (g *GroupClient) DeleteGroup(sysID string) error

DeleteGroup removes a group (sets active = false)

func (*GroupClient) DeleteGroupWithContext

func (g *GroupClient) DeleteGroupWithContext(ctx context.Context, sysID string) error

DeleteGroupWithContext removes a group with context support

func (*GroupClient) GetGroup

func (g *GroupClient) GetGroup(sysID string) (*Group, error)

GetGroup retrieves a group by sys_id

func (*GroupClient) GetGroupByName

func (g *GroupClient) GetGroupByName(groupName string) (*Group, error)

GetGroupByName retrieves a group by name

func (*GroupClient) GetGroupByNameWithContext

func (g *GroupClient) GetGroupByNameWithContext(ctx context.Context, groupName string) (*Group, error)

GetGroupByNameWithContext retrieves a group by name with context support

func (*GroupClient) GetGroupHierarchy

func (g *GroupClient) GetGroupHierarchy(groupSysID string) (map[string][]*Group, error)

GetGroupHierarchy retrieves the hierarchy of groups including parent-child relationships

func (*GroupClient) GetGroupHierarchyWithContext

func (g *GroupClient) GetGroupHierarchyWithContext(ctx context.Context, groupSysID string) (map[string][]*Group, error)

GetGroupHierarchyWithContext retrieves group hierarchy with context support

func (*GroupClient) GetGroupMembers

func (g *GroupClient) GetGroupMembers(groupSysID string) ([]*GroupMember, error)

GetGroupMembers retrieves all members of a group

func (*GroupClient) GetGroupMembersWithContext

func (g *GroupClient) GetGroupMembersWithContext(ctx context.Context, groupSysID string) ([]*GroupMember, error)

GetGroupMembersWithContext retrieves all members of a group with context support

func (*GroupClient) GetGroupWithContext

func (g *GroupClient) GetGroupWithContext(ctx context.Context, sysID string) (*Group, error)

GetGroupWithContext retrieves a group by sys_id with context support

func (*GroupClient) GetUserGroups

func (g *GroupClient) GetUserGroups(userSysID string) ([]*GroupMember, error)

GetUserGroups retrieves all groups a user is a member of

func (*GroupClient) GetUserGroupsWithContext

func (g *GroupClient) GetUserGroupsWithContext(ctx context.Context, userSysID string) ([]*GroupMember, error)

GetUserGroupsWithContext retrieves all groups a user is a member of with context support

func (*GroupClient) ListGroups

func (g *GroupClient) ListGroups(filter *GroupFilter) ([]*Group, error)

ListGroups retrieves groups based on filter criteria

func (*GroupClient) ListGroupsWithContext

func (g *GroupClient) ListGroupsWithContext(ctx context.Context, filter *GroupFilter) ([]*Group, error)

ListGroupsWithContext retrieves groups based on filter criteria with context support

func (*GroupClient) RemoveUserFromGroup

func (g *GroupClient) RemoveUserFromGroup(userSysID, groupSysID string) error

RemoveUserFromGroup removes a user from a group

func (*GroupClient) RemoveUserFromGroupWithContext

func (g *GroupClient) RemoveUserFromGroupWithContext(ctx context.Context, userSysID, groupSysID string) error

RemoveUserFromGroupWithContext removes a user from a group with context support

func (*GroupClient) UpdateGroup

func (g *GroupClient) UpdateGroup(sysID string, updates map[string]interface{}) (*Group, error)

UpdateGroup updates an existing group

func (*GroupClient) UpdateGroupWithContext

func (g *GroupClient) UpdateGroupWithContext(ctx context.Context, sysID string, updates map[string]interface{}) (*Group, error)

UpdateGroupWithContext updates an existing group with context support

type GroupFilter

type GroupFilter struct {
	Active     *bool    `json:"active,omitempty"`
	Type       string   `json:"type,omitempty"`
	Parent     string   `json:"parent,omitempty"`
	Manager    string   `json:"manager,omitempty"`
	Name       string   `json:"name,omitempty"`
	CostCenter string   `json:"cost_center,omitempty"`
	Limit      int      `json:"limit,omitempty"`
	Offset     int      `json:"offset,omitempty"`
	OrderBy    string   `json:"order_by,omitempty"`
	Fields     []string `json:"fields,omitempty"`
}

GroupFilter provides filtering options for group queries

type GroupMember

type GroupMember struct {
	SysID      string    `json:"sys_id"`
	UserSysID  string    `json:"user"`
	GroupSysID string    `json:"group"`
	AddedBy    string    `json:"sys_created_by"`
	AddedOn    time.Time `json:"sys_created_on"`
}

GroupMember represents a group membership

type IdentityClient

type IdentityClient struct {
	// contains filtered or unexported fields
}

IdentityClient provides methods for managing users, roles, and groups in ServiceNow

func NewIdentityClient

func NewIdentityClient(client *core.Client) *IdentityClient

NewIdentityClient creates a new identity client

func (*IdentityClient) CreateUser

func (i *IdentityClient) CreateUser(userData map[string]interface{}) (*User, error)

CreateUser creates a new user

func (*IdentityClient) CreateUserWithContext

func (i *IdentityClient) CreateUserWithContext(ctx context.Context, userData map[string]interface{}) (*User, error)

CreateUserWithContext creates a new user with context support

func (*IdentityClient) DeleteUser

func (i *IdentityClient) DeleteUser(sysID string) error

DeleteUser removes a user (sets active = false)

func (*IdentityClient) DeleteUserWithContext

func (i *IdentityClient) DeleteUserWithContext(ctx context.Context, sysID string) error

DeleteUserWithContext removes a user with context support

func (*IdentityClient) GetUser

func (i *IdentityClient) GetUser(sysID string) (*User, error)

GetUser retrieves a user by sys_id

func (*IdentityClient) GetUserByUsername

func (i *IdentityClient) GetUserByUsername(username string) (*User, error)

GetUserByUsername retrieves a user by username

func (*IdentityClient) GetUserByUsernameWithContext

func (i *IdentityClient) GetUserByUsernameWithContext(ctx context.Context, username string) (*User, error)

GetUserByUsernameWithContext retrieves a user by username with context support

func (*IdentityClient) GetUserWithContext

func (i *IdentityClient) GetUserWithContext(ctx context.Context, sysID string) (*User, error)

GetUserWithContext retrieves a user by sys_id with context support

func (*IdentityClient) ListUsers

func (i *IdentityClient) ListUsers(filter *UserFilter) ([]*User, error)

ListUsers retrieves users based on filter criteria

func (*IdentityClient) ListUsersWithContext

func (i *IdentityClient) ListUsersWithContext(ctx context.Context, filter *UserFilter) ([]*User, error)

ListUsersWithContext retrieves users based on filter criteria with context support

func (*IdentityClient) NewAccessClient

func (i *IdentityClient) NewAccessClient() *AccessClient

NewAccessClient creates a new access client

func (*IdentityClient) NewGroupClient

func (i *IdentityClient) NewGroupClient() *GroupClient

NewGroupClient creates a new group client

func (*IdentityClient) NewRoleClient

func (i *IdentityClient) NewRoleClient() *RoleClient

NewRoleClient creates a new role client

func (*IdentityClient) UpdateUser

func (i *IdentityClient) UpdateUser(sysID string, updates map[string]interface{}) (*User, error)

UpdateUser updates an existing user

func (*IdentityClient) UpdateUserWithContext

func (i *IdentityClient) UpdateUserWithContext(ctx context.Context, sysID string, updates map[string]interface{}) (*User, error)

UpdateUserWithContext updates an existing user with context support

type Role

type Role struct {
	SysID                string                 `json:"sys_id"`
	Name                 string                 `json:"name"`
	Description          string                 `json:"description"`
	Active               bool                   `json:"active"`
	Assignable           bool                   `json:"assignable_by"`
	CanDelegate          bool                   `json:"can_delegate"`
	ElevatedPrivilege    bool                   `json:"elevated_privilege"`
	IncludesRoles        []string               `json:"includes_roles,omitempty"`
	RequiresSubscription string                 `json:"requires_subscription"`
	Scoped               bool                   `json:"scoped"`
	ApplicationScope     string                 `json:"application"`
	Suffix               string                 `json:"suffix"`
	GrantsAdmin          bool                   `json:"grants_admin"`
	Users                []string               `json:"users,omitempty"`
	Groups               []string               `json:"groups,omitempty"`
	Attributes           map[string]interface{} `json:"attributes,omitempty"`
	CreatedBy            string                 `json:"sys_created_by"`
	CreatedOn            time.Time              `json:"sys_created_on"`
	UpdatedBy            string                 `json:"sys_updated_by"`
	UpdatedOn            time.Time              `json:"sys_updated_on"`
}

Role represents a ServiceNow role

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

RoleClient handles role management operations

func (*RoleClient) AssignRoleToUser

func (r *RoleClient) AssignRoleToUser(userSysID, roleSysID string) (*UserRole, error)

AssignRoleToUser assigns a role to a user

func (*RoleClient) AssignRoleToUserWithContext

func (r *RoleClient) AssignRoleToUserWithContext(ctx context.Context, userSysID, roleSysID string) (*UserRole, error)

AssignRoleToUserWithContext assigns a role to a user with context support

func (*RoleClient) CreateRole

func (r *RoleClient) CreateRole(roleData map[string]interface{}) (*Role, error)

CreateRole creates a new role

func (*RoleClient) CreateRoleWithContext

func (r *RoleClient) CreateRoleWithContext(ctx context.Context, roleData map[string]interface{}) (*Role, error)

CreateRoleWithContext creates a new role with context support

func (*RoleClient) DeleteRole

func (r *RoleClient) DeleteRole(sysID string) error

DeleteRole removes a role (sets active = false)

func (*RoleClient) DeleteRoleWithContext

func (r *RoleClient) DeleteRoleWithContext(ctx context.Context, sysID string) error

DeleteRoleWithContext removes a role with context support

func (*RoleClient) GetRole

func (r *RoleClient) GetRole(sysID string) (*Role, error)

GetRole retrieves a role by sys_id

func (*RoleClient) GetRoleByName

func (r *RoleClient) GetRoleByName(roleName string) (*Role, error)

GetRoleByName retrieves a role by name

func (*RoleClient) GetRoleByNameWithContext

func (r *RoleClient) GetRoleByNameWithContext(ctx context.Context, roleName string) (*Role, error)

GetRoleByNameWithContext retrieves a role by name with context support

func (*RoleClient) GetRoleHierarchy

func (r *RoleClient) GetRoleHierarchy(roleSysID string) (map[string][]*Role, error)

GetRoleHierarchy retrieves the hierarchy of roles including included roles

func (*RoleClient) GetRoleHierarchyWithContext

func (r *RoleClient) GetRoleHierarchyWithContext(ctx context.Context, roleSysID string) (map[string][]*Role, error)

GetRoleHierarchyWithContext retrieves role hierarchy with context support

func (*RoleClient) GetRoleUsers

func (r *RoleClient) GetRoleUsers(roleSysID string) ([]*UserRole, error)

GetRoleUsers retrieves all users assigned to a role

func (*RoleClient) GetRoleUsersWithContext

func (r *RoleClient) GetRoleUsersWithContext(ctx context.Context, roleSysID string) ([]*UserRole, error)

GetRoleUsersWithContext retrieves all users assigned to a role with context support

func (*RoleClient) GetRoleWithContext

func (r *RoleClient) GetRoleWithContext(ctx context.Context, sysID string) (*Role, error)

GetRoleWithContext retrieves a role by sys_id with context support

func (*RoleClient) GetUserRoles

func (r *RoleClient) GetUserRoles(userSysID string) ([]*UserRole, error)

GetUserRoles retrieves all roles assigned to a user

func (*RoleClient) GetUserRolesWithContext

func (r *RoleClient) GetUserRolesWithContext(ctx context.Context, userSysID string) ([]*UserRole, error)

GetUserRolesWithContext retrieves all roles assigned to a user with context support

func (*RoleClient) ListRoles

func (r *RoleClient) ListRoles(filter *RoleFilter) ([]*Role, error)

ListRoles retrieves roles based on filter criteria

func (*RoleClient) ListRolesWithContext

func (r *RoleClient) ListRolesWithContext(ctx context.Context, filter *RoleFilter) ([]*Role, error)

ListRolesWithContext retrieves roles based on filter criteria with context support

func (*RoleClient) RemoveRoleFromUser

func (r *RoleClient) RemoveRoleFromUser(userSysID, roleSysID string) error

RemoveRoleFromUser removes a role from a user

func (*RoleClient) RemoveRoleFromUserWithContext

func (r *RoleClient) RemoveRoleFromUserWithContext(ctx context.Context, userSysID, roleSysID string) error

RemoveRoleFromUserWithContext removes a role from a user with context support

func (*RoleClient) UpdateRole

func (r *RoleClient) UpdateRole(sysID string, updates map[string]interface{}) (*Role, error)

UpdateRole updates an existing role

func (*RoleClient) UpdateRoleWithContext

func (r *RoleClient) UpdateRoleWithContext(ctx context.Context, sysID string, updates map[string]interface{}) (*Role, error)

UpdateRoleWithContext updates an existing role with context support

type RoleFilter

type RoleFilter struct {
	Active            *bool    `json:"active,omitempty"`
	Assignable        *bool    `json:"assignable,omitempty"`
	ElevatedPrivilege *bool    `json:"elevated_privilege,omitempty"`
	Application       string   `json:"application,omitempty"`
	Name              string   `json:"name,omitempty"`
	Limit             int      `json:"limit,omitempty"`
	Offset            int      `json:"offset,omitempty"`
	OrderBy           string   `json:"order_by,omitempty"`
	Fields            []string `json:"fields,omitempty"`
}

RoleFilter provides filtering options for role queries

type User

type User struct {
	SysID               string                 `json:"sys_id"`
	UserName            string                 `json:"user_name"`
	FirstName           string                 `json:"first_name"`
	LastName            string                 `json:"last_name"`
	MiddleName          string                 `json:"middle_name"`
	Name                string                 `json:"name"`
	Email               string                 `json:"email"`
	Phone               string                 `json:"phone"`
	MobilePhone         string                 `json:"mobile_phone"`
	Title               string                 `json:"title"`
	Department          string                 `json:"department"`
	Location            string                 `json:"location"`
	Building            string                 `json:"building"`
	Room                string                 `json:"room"`
	Company             string                 `json:"company"`
	CostCenter          string                 `json:"cost_center"`
	Manager             string                 `json:"manager"`
	Active              bool                   `json:"active"`
	Locked              bool                   `json:"locked_out"`
	PasswordNeedsReset  bool                   `json:"password_needs_reset"`
	Source              string                 `json:"source"`
	UserPassword        string                 `json:"user_password"`
	LDAPServer          string                 `json:"ldap_server"`
	EnableMultifactor   bool                   `json:"enable_multifactor_authn"`
	FailedAttempts      int                    `json:"failed_attempts"`
	LastLoginTime       time.Time              `json:"last_login_time"`
	LastLoginDevice     string                 `json:"last_login_device"`
	VIP                 bool                   `json:"vip"`
	InternalIntegration bool                   `json:"internal_integration_user"`
	WebServiceAccess    bool                   `json:"web_service_access_only"`
	Avatar              string                 `json:"avatar"`
	Photo               string                 `json:"photo"`
	TimeZone            string                 `json:"time_zone"`
	DateFormat          string                 `json:"date_format"`
	TimeFormat          string                 `json:"time_format"`
	Language            string                 `json:"preferred_language"`
	Country             string                 `json:"country"`
	State               string                 `json:"state"`
	City                string                 `json:"city"`
	Zip                 string                 `json:"zip"`
	Address             string                 `json:"street"`
	Schedule            string                 `json:"schedule"`
	CalendarIntegration string                 `json:"calendar_integration"`
	Roles               []string               `json:"roles,omitempty"`
	Groups              []string               `json:"groups,omitempty"`
	Attributes          map[string]interface{} `json:"attributes,omitempty"`
	CreatedBy           string                 `json:"sys_created_by"`
	CreatedOn           time.Time              `json:"sys_created_on"`
	UpdatedBy           string                 `json:"sys_updated_by"`
	UpdatedOn           time.Time              `json:"sys_updated_on"`
}

User represents a ServiceNow user

type UserFilter

type UserFilter struct {
	Active         *bool     `json:"active,omitempty"`
	Department     string    `json:"department,omitempty"`
	Title          string    `json:"title,omitempty"`
	Company        string    `json:"company,omitempty"`
	Manager        string    `json:"manager,omitempty"`
	Location       string    `json:"location,omitempty"`
	Email          string    `json:"email,omitempty"`
	Role           string    `json:"role,omitempty"`
	Group          string    `json:"group,omitempty"`
	LastLoginAfter time.Time `json:"last_login_after,omitempty"`
	CreatedAfter   time.Time `json:"created_after,omitempty"`
	CreatedBefore  time.Time `json:"created_before,omitempty"`
	VIP            *bool     `json:"vip,omitempty"`
	Source         string    `json:"source,omitempty"`
	Limit          int       `json:"limit,omitempty"`
	Offset         int       `json:"offset,omitempty"`
	OrderBy        string    `json:"order_by,omitempty"`
	Fields         []string  `json:"fields,omitempty"`
}

UserFilter provides filtering options for user queries

type UserPreference

type UserPreference struct {
	SysID     string `json:"sys_id"`
	UserSysID string `json:"user"`
	Name      string `json:"name"`
	Value     string `json:"value"`
	Type      string `json:"type"`
	Personal  bool   `json:"personal"`
}

UserPreference represents a user preference setting

type UserRole

type UserRole struct {
	SysID     string    `json:"sys_id"`
	UserSysID string    `json:"user"`
	RoleSysID string    `json:"role"`
	Granted   string    `json:"granted_by"`
	GrantedOn time.Time `json:"sys_created_on"`
	State     string    `json:"state"`
	Inherited bool      `json:"inherited"`
}

UserRole represents a user-role assignment

type UserSession

type UserSession struct {
	SysID          string    `json:"sys_id"`
	UserSysID      string    `json:"user"`
	LoginTime      time.Time `json:"login_time"`
	LastAccessTime time.Time `json:"last_access_time"`
	IPAddress      string    `json:"ip_address"`
	UserAgent      string    `json:"user_agent"`
	SessionID      string    `json:"session_id"`
	Active         bool      `json:"active"`
	LoginType      string    `json:"login_type"`
	Device         string    `json:"device"`
	Application    string    `json:"application"`
	IdleTime       int       `json:"idle_time"`
	TimeZone       string    `json:"time_zone"`
}

UserSession represents an active user session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL