- Implement Audit Service (2.5) - gRPC server with Record and Query operations - Database persistence with audit schema - Service registry integration - Entry point: cmd/audit-service - Implement Identity Service (2.2) - User CRUD operations - Password hashing with argon2id - Email verification and password reset flows - Entry point: cmd/identity-service - Fix package naming conflicts in user_service.go - Implement Auth Service (2.1) - JWT token generation and validation - Login, RefreshToken, ValidateToken, Logout RPCs - Integration with Identity Service - Entry point: cmd/auth-service - Note: RefreshToken entity needs Ent generation - Implement Authz Service (2.3, 2.4) - Permission checking and authorization - User roles and permissions retrieval - RBAC-based authorization - Entry point: cmd/authz-service - Implement gRPC clients for all services - Auth, Identity, Authz, and Audit clients - Service discovery integration - Full gRPC communication - Add service configurations to config/default.yaml - Create SUMMARY.md with implementation details and testing instructions - Fix compilation errors in Identity Service (password package conflicts) - All services build successfully and tests pass
110 lines
3.5 KiB
Go
110 lines
3.5 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package auditlog
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the auditlog type in the database.
|
|
Label = "audit_log"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldAction holds the string denoting the action field in the database.
|
|
FieldAction = "action"
|
|
// FieldResource holds the string denoting the resource field in the database.
|
|
FieldResource = "resource"
|
|
// FieldResourceID holds the string denoting the resource_id field in the database.
|
|
FieldResourceID = "resource_id"
|
|
// FieldIPAddress holds the string denoting the ip_address field in the database.
|
|
FieldIPAddress = "ip_address"
|
|
// FieldUserAgent holds the string denoting the user_agent field in the database.
|
|
FieldUserAgent = "user_agent"
|
|
// FieldMetadata holds the string denoting the metadata field in the database.
|
|
FieldMetadata = "metadata"
|
|
// FieldTimestamp holds the string denoting the timestamp field in the database.
|
|
FieldTimestamp = "timestamp"
|
|
// Table holds the table name of the auditlog in the database.
|
|
Table = "audit_logs"
|
|
)
|
|
|
|
// Columns holds all SQL columns for auditlog fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldUserID,
|
|
FieldAction,
|
|
FieldResource,
|
|
FieldResourceID,
|
|
FieldIPAddress,
|
|
FieldUserAgent,
|
|
FieldMetadata,
|
|
FieldTimestamp,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// UserIDValidator is a validator for the "user_id" field. It is called by the builders before save.
|
|
UserIDValidator func(string) error
|
|
// ActionValidator is a validator for the "action" field. It is called by the builders before save.
|
|
ActionValidator func(string) error
|
|
// DefaultTimestamp holds the default value on creation for the "timestamp" field.
|
|
DefaultTimestamp func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the AuditLog queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAction orders the results by the action field.
|
|
func ByAction(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldAction, opts...).ToFunc()
|
|
}
|
|
|
|
// ByResource orders the results by the resource field.
|
|
func ByResource(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldResource, opts...).ToFunc()
|
|
}
|
|
|
|
// ByResourceID orders the results by the resource_id field.
|
|
func ByResourceID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldResourceID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByIPAddress orders the results by the ip_address field.
|
|
func ByIPAddress(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldIPAddress, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserAgent orders the results by the user_agent field.
|
|
func ByUserAgent(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserAgent, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTimestamp orders the results by the timestamp field.
|
|
func ByTimestamp(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTimestamp, opts...).ToFunc()
|
|
}
|