Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Role for third party activities RoleThirdParty Role = "THIRD_PARTY" // Role for person activities RolePerson = "PERSON" // Role for admin activities RoleAdmin = "ADMIN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
const ( // Successful account registration. RegistrationSuccess Action = "reg_success" // Failed account registration. RegistrationFailure Action = "reg_fail" // User successful login to the system. ActionLoginSuccess Action = "login_success" // User failed login to the system. ActionLoginFail Action = "login_fail" // User logout from the system. ActionLogout Action = "logout" // Resource detailed view. ActionView Action = "view" // Resource search. ActionSearch Action = "search" // New resource creation. ActionCreate Action = "create" // Existing resource modification. ActionModify Action = "modify" // Existing resource deletion. ActionDelete Action = "delete" // Export person data outside the system. ActionExport Action = "export" // Request for the person data form outer source. ServiceCall Action = "service_call" )
type Audit ¶
type Audit interface {
// PersonRequest audits person request.
PersonRequest(ctx *azugo.Context, request AuditRequest, opts ...http.RequestOption) error
}
Audit interface
type AuditRequest ¶
type AuditRequest struct {
// ClientID represents audit API caller identifier.
ClientID string `json:"clientId"`
// Endpoint represents the accessed endpoint.
Endpoint *string `json:"endpoint"`
// Action represents audit action.
Action string `json:"action"`
// RequestParameters represents data request parameters.
RequestParameters *string `json:"requestParameters"`
// Person represents the accessed endpoint.
Person *Person `json:"person"`
// Resources represents identifier ist of the accessed resources.
Resources *[]Resource `json:"resources"`
// IPAddress represents IP address of the caller.
IPAddress *string `json:"ipAddress"`
// UserAgent represents user agent of the caller.
UserAgent *string `json:"userAgent"`
}
AuditRequest represents a request to save audit details.
func (*AuditRequest) Validate ¶
func (r *AuditRequest) Validate(validate *validation.Validate) error
type Configuration ¶
type Configuration struct {
Endpoint string `mapstructure:"endpoint" validate:"required,url"`
}
Configuration is the configuration for the audit middleware.
func (*Configuration) Bind ¶
func (c *Configuration) Bind(prefix string, v *viper.Viper)
Bind configuration section.
func (*Configuration) Validate ¶
func (c *Configuration) Validate(validate *validation.Validate) error
Validate application configuration.
type Person ¶
type Person struct {
// IdentifierType represents identifier type of the person whose data has been accessed.
IdentifierType *string `json:"identifierType"`
// Identifier represents identifier of the person whose data has been accessed.
Identifier *string `json:"identifier"`
// GivenName represents given name of the person whose data has been accessed.
GivenName *string `json:"givenName"`
// FamilyName represents family name of the person whose data has been accessed.
FamilyName *string `json:"familyName"`
}
Person represents a person whose data is accessed.
type Resource ¶
type Resource struct {
// ID represents identifier of the resource.
ID string `json:"id"`
// Provider represents provider of the resource, e.g. RTU, CSDD, etc.
Provider string `json:"provider"`
// Type represents type of the resource.
Type string `json:"type"`
}
Resource represents a resource accessed by user.
Click to show internal directories.
Click to hide internal directories.