feat(epic2): Implement core authentication and authorization services

- 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
This commit is contained in:
2025-11-06 20:07:20 +01:00
parent da7a4e3703
commit b1b895e818
91 changed files with 19502 additions and 375 deletions

View File

@@ -64,9 +64,9 @@ func IDContainsFold(id string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldID, id))
}
// ActorID applies equality check predicate on the "actor_id" field. It's identical to ActorIDEQ.
func ActorID(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldActorID, v))
// UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
func UserID(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldUserID, v))
}
// Action applies equality check predicate on the "action" field. It's identical to ActionEQ.
@@ -74,9 +74,24 @@ func Action(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldAction, v))
}
// TargetID applies equality check predicate on the "target_id" field. It's identical to TargetIDEQ.
func TargetID(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldTargetID, v))
// Resource applies equality check predicate on the "resource" field. It's identical to ResourceEQ.
func Resource(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldResource, v))
}
// ResourceID applies equality check predicate on the "resource_id" field. It's identical to ResourceIDEQ.
func ResourceID(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldResourceID, v))
}
// IPAddress applies equality check predicate on the "ip_address" field. It's identical to IPAddressEQ.
func IPAddress(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldIPAddress, v))
}
// UserAgent applies equality check predicate on the "user_agent" field. It's identical to UserAgentEQ.
func UserAgent(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldUserAgent, v))
}
// Timestamp applies equality check predicate on the "timestamp" field. It's identical to TimestampEQ.
@@ -84,69 +99,69 @@ func Timestamp(v time.Time) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldTimestamp, v))
}
// ActorIDEQ applies the EQ predicate on the "actor_id" field.
func ActorIDEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldActorID, v))
// UserIDEQ applies the EQ predicate on the "user_id" field.
func UserIDEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldUserID, v))
}
// ActorIDNEQ applies the NEQ predicate on the "actor_id" field.
func ActorIDNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldActorID, v))
// UserIDNEQ applies the NEQ predicate on the "user_id" field.
func UserIDNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldUserID, v))
}
// ActorIDIn applies the In predicate on the "actor_id" field.
func ActorIDIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldActorID, vs...))
// UserIDIn applies the In predicate on the "user_id" field.
func UserIDIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldUserID, vs...))
}
// ActorIDNotIn applies the NotIn predicate on the "actor_id" field.
func ActorIDNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldActorID, vs...))
// UserIDNotIn applies the NotIn predicate on the "user_id" field.
func UserIDNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldUserID, vs...))
}
// ActorIDGT applies the GT predicate on the "actor_id" field.
func ActorIDGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldActorID, v))
// UserIDGT applies the GT predicate on the "user_id" field.
func UserIDGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldUserID, v))
}
// ActorIDGTE applies the GTE predicate on the "actor_id" field.
func ActorIDGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldActorID, v))
// UserIDGTE applies the GTE predicate on the "user_id" field.
func UserIDGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldUserID, v))
}
// ActorIDLT applies the LT predicate on the "actor_id" field.
func ActorIDLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldActorID, v))
// UserIDLT applies the LT predicate on the "user_id" field.
func UserIDLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldUserID, v))
}
// ActorIDLTE applies the LTE predicate on the "actor_id" field.
func ActorIDLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldActorID, v))
// UserIDLTE applies the LTE predicate on the "user_id" field.
func UserIDLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldUserID, v))
}
// ActorIDContains applies the Contains predicate on the "actor_id" field.
func ActorIDContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldActorID, v))
// UserIDContains applies the Contains predicate on the "user_id" field.
func UserIDContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldUserID, v))
}
// ActorIDHasPrefix applies the HasPrefix predicate on the "actor_id" field.
func ActorIDHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldActorID, v))
// UserIDHasPrefix applies the HasPrefix predicate on the "user_id" field.
func UserIDHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldUserID, v))
}
// ActorIDHasSuffix applies the HasSuffix predicate on the "actor_id" field.
func ActorIDHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldActorID, v))
// UserIDHasSuffix applies the HasSuffix predicate on the "user_id" field.
func UserIDHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldUserID, v))
}
// ActorIDEqualFold applies the EqualFold predicate on the "actor_id" field.
func ActorIDEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldActorID, v))
// UserIDEqualFold applies the EqualFold predicate on the "user_id" field.
func UserIDEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldUserID, v))
}
// ActorIDContainsFold applies the ContainsFold predicate on the "actor_id" field.
func ActorIDContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldActorID, v))
// UserIDContainsFold applies the ContainsFold predicate on the "user_id" field.
func UserIDContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldUserID, v))
}
// ActionEQ applies the EQ predicate on the "action" field.
@@ -214,79 +229,304 @@ func ActionContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldAction, v))
}
// TargetIDEQ applies the EQ predicate on the "target_id" field.
func TargetIDEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldTargetID, v))
// ResourceEQ applies the EQ predicate on the "resource" field.
func ResourceEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldResource, v))
}
// TargetIDNEQ applies the NEQ predicate on the "target_id" field.
func TargetIDNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldTargetID, v))
// ResourceNEQ applies the NEQ predicate on the "resource" field.
func ResourceNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldResource, v))
}
// TargetIDIn applies the In predicate on the "target_id" field.
func TargetIDIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldTargetID, vs...))
// ResourceIn applies the In predicate on the "resource" field.
func ResourceIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldResource, vs...))
}
// TargetIDNotIn applies the NotIn predicate on the "target_id" field.
func TargetIDNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldTargetID, vs...))
// ResourceNotIn applies the NotIn predicate on the "resource" field.
func ResourceNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldResource, vs...))
}
// TargetIDGT applies the GT predicate on the "target_id" field.
func TargetIDGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldTargetID, v))
// ResourceGT applies the GT predicate on the "resource" field.
func ResourceGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldResource, v))
}
// TargetIDGTE applies the GTE predicate on the "target_id" field.
func TargetIDGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldTargetID, v))
// ResourceGTE applies the GTE predicate on the "resource" field.
func ResourceGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldResource, v))
}
// TargetIDLT applies the LT predicate on the "target_id" field.
func TargetIDLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldTargetID, v))
// ResourceLT applies the LT predicate on the "resource" field.
func ResourceLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldResource, v))
}
// TargetIDLTE applies the LTE predicate on the "target_id" field.
func TargetIDLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldTargetID, v))
// ResourceLTE applies the LTE predicate on the "resource" field.
func ResourceLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldResource, v))
}
// TargetIDContains applies the Contains predicate on the "target_id" field.
func TargetIDContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldTargetID, v))
// ResourceContains applies the Contains predicate on the "resource" field.
func ResourceContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldResource, v))
}
// TargetIDHasPrefix applies the HasPrefix predicate on the "target_id" field.
func TargetIDHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldTargetID, v))
// ResourceHasPrefix applies the HasPrefix predicate on the "resource" field.
func ResourceHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldResource, v))
}
// TargetIDHasSuffix applies the HasSuffix predicate on the "target_id" field.
func TargetIDHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldTargetID, v))
// ResourceHasSuffix applies the HasSuffix predicate on the "resource" field.
func ResourceHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldResource, v))
}
// TargetIDIsNil applies the IsNil predicate on the "target_id" field.
func TargetIDIsNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldIsNull(FieldTargetID))
// ResourceIsNil applies the IsNil predicate on the "resource" field.
func ResourceIsNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldIsNull(FieldResource))
}
// TargetIDNotNil applies the NotNil predicate on the "target_id" field.
func TargetIDNotNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotNull(FieldTargetID))
// ResourceNotNil applies the NotNil predicate on the "resource" field.
func ResourceNotNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotNull(FieldResource))
}
// TargetIDEqualFold applies the EqualFold predicate on the "target_id" field.
func TargetIDEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldTargetID, v))
// ResourceEqualFold applies the EqualFold predicate on the "resource" field.
func ResourceEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldResource, v))
}
// TargetIDContainsFold applies the ContainsFold predicate on the "target_id" field.
func TargetIDContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldTargetID, v))
// ResourceContainsFold applies the ContainsFold predicate on the "resource" field.
func ResourceContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldResource, v))
}
// ResourceIDEQ applies the EQ predicate on the "resource_id" field.
func ResourceIDEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldResourceID, v))
}
// ResourceIDNEQ applies the NEQ predicate on the "resource_id" field.
func ResourceIDNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldResourceID, v))
}
// ResourceIDIn applies the In predicate on the "resource_id" field.
func ResourceIDIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldResourceID, vs...))
}
// ResourceIDNotIn applies the NotIn predicate on the "resource_id" field.
func ResourceIDNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldResourceID, vs...))
}
// ResourceIDGT applies the GT predicate on the "resource_id" field.
func ResourceIDGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldResourceID, v))
}
// ResourceIDGTE applies the GTE predicate on the "resource_id" field.
func ResourceIDGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldResourceID, v))
}
// ResourceIDLT applies the LT predicate on the "resource_id" field.
func ResourceIDLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldResourceID, v))
}
// ResourceIDLTE applies the LTE predicate on the "resource_id" field.
func ResourceIDLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldResourceID, v))
}
// ResourceIDContains applies the Contains predicate on the "resource_id" field.
func ResourceIDContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldResourceID, v))
}
// ResourceIDHasPrefix applies the HasPrefix predicate on the "resource_id" field.
func ResourceIDHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldResourceID, v))
}
// ResourceIDHasSuffix applies the HasSuffix predicate on the "resource_id" field.
func ResourceIDHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldResourceID, v))
}
// ResourceIDIsNil applies the IsNil predicate on the "resource_id" field.
func ResourceIDIsNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldIsNull(FieldResourceID))
}
// ResourceIDNotNil applies the NotNil predicate on the "resource_id" field.
func ResourceIDNotNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotNull(FieldResourceID))
}
// ResourceIDEqualFold applies the EqualFold predicate on the "resource_id" field.
func ResourceIDEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldResourceID, v))
}
// ResourceIDContainsFold applies the ContainsFold predicate on the "resource_id" field.
func ResourceIDContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldResourceID, v))
}
// IPAddressEQ applies the EQ predicate on the "ip_address" field.
func IPAddressEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldIPAddress, v))
}
// IPAddressNEQ applies the NEQ predicate on the "ip_address" field.
func IPAddressNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldIPAddress, v))
}
// IPAddressIn applies the In predicate on the "ip_address" field.
func IPAddressIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldIPAddress, vs...))
}
// IPAddressNotIn applies the NotIn predicate on the "ip_address" field.
func IPAddressNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldIPAddress, vs...))
}
// IPAddressGT applies the GT predicate on the "ip_address" field.
func IPAddressGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldIPAddress, v))
}
// IPAddressGTE applies the GTE predicate on the "ip_address" field.
func IPAddressGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldIPAddress, v))
}
// IPAddressLT applies the LT predicate on the "ip_address" field.
func IPAddressLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldIPAddress, v))
}
// IPAddressLTE applies the LTE predicate on the "ip_address" field.
func IPAddressLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldIPAddress, v))
}
// IPAddressContains applies the Contains predicate on the "ip_address" field.
func IPAddressContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldIPAddress, v))
}
// IPAddressHasPrefix applies the HasPrefix predicate on the "ip_address" field.
func IPAddressHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldIPAddress, v))
}
// IPAddressHasSuffix applies the HasSuffix predicate on the "ip_address" field.
func IPAddressHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldIPAddress, v))
}
// IPAddressIsNil applies the IsNil predicate on the "ip_address" field.
func IPAddressIsNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldIsNull(FieldIPAddress))
}
// IPAddressNotNil applies the NotNil predicate on the "ip_address" field.
func IPAddressNotNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotNull(FieldIPAddress))
}
// IPAddressEqualFold applies the EqualFold predicate on the "ip_address" field.
func IPAddressEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldIPAddress, v))
}
// IPAddressContainsFold applies the ContainsFold predicate on the "ip_address" field.
func IPAddressContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldIPAddress, v))
}
// UserAgentEQ applies the EQ predicate on the "user_agent" field.
func UserAgentEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEQ(FieldUserAgent, v))
}
// UserAgentNEQ applies the NEQ predicate on the "user_agent" field.
func UserAgentNEQ(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNEQ(FieldUserAgent, v))
}
// UserAgentIn applies the In predicate on the "user_agent" field.
func UserAgentIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldIn(FieldUserAgent, vs...))
}
// UserAgentNotIn applies the NotIn predicate on the "user_agent" field.
func UserAgentNotIn(vs ...string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotIn(FieldUserAgent, vs...))
}
// UserAgentGT applies the GT predicate on the "user_agent" field.
func UserAgentGT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGT(FieldUserAgent, v))
}
// UserAgentGTE applies the GTE predicate on the "user_agent" field.
func UserAgentGTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldGTE(FieldUserAgent, v))
}
// UserAgentLT applies the LT predicate on the "user_agent" field.
func UserAgentLT(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLT(FieldUserAgent, v))
}
// UserAgentLTE applies the LTE predicate on the "user_agent" field.
func UserAgentLTE(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldLTE(FieldUserAgent, v))
}
// UserAgentContains applies the Contains predicate on the "user_agent" field.
func UserAgentContains(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContains(FieldUserAgent, v))
}
// UserAgentHasPrefix applies the HasPrefix predicate on the "user_agent" field.
func UserAgentHasPrefix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasPrefix(FieldUserAgent, v))
}
// UserAgentHasSuffix applies the HasSuffix predicate on the "user_agent" field.
func UserAgentHasSuffix(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldHasSuffix(FieldUserAgent, v))
}
// UserAgentIsNil applies the IsNil predicate on the "user_agent" field.
func UserAgentIsNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldIsNull(FieldUserAgent))
}
// UserAgentNotNil applies the NotNil predicate on the "user_agent" field.
func UserAgentNotNil() predicate.AuditLog {
return predicate.AuditLog(sql.FieldNotNull(FieldUserAgent))
}
// UserAgentEqualFold applies the EqualFold predicate on the "user_agent" field.
func UserAgentEqualFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldEqualFold(FieldUserAgent, v))
}
// UserAgentContainsFold applies the ContainsFold predicate on the "user_agent" field.
func UserAgentContainsFold(v string) predicate.AuditLog {
return predicate.AuditLog(sql.FieldContainsFold(FieldUserAgent, v))
}
// MetadataIsNil applies the IsNil predicate on the "metadata" field.