Audit events serializing ActiveModel::Attribute::FromDatabase
In https://gitlab.com/gitlab-org/gitlab/-/jobs/2730720028, we see that one of the tests produces an audit event in th eform:
---
:custom_message: Repository Download Started
:author_name: !ruby/object:DeployToken
concise_attributes:
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: deploy_token_type
value_before_type_cast: 1
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: id
value_before_type_cast: 2
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: revoked
value_before_type_cast: false
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: read_repository
value_before_type_cast: true
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: read_registry
value_before_type_cast: true
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: expires_at
value_before_type_cast: 2022-07-21 15:35:10.470483000 +00:00
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: created_at
value_before_type_cast: 2022-07-16 15:35:10.471348000 +00:00
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: name
value_before_type_cast: PDT 2
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: username
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: token_encrypted
value_before_type_cast: "/5UZT6X9IF6ZV6prAVQ8DF5uO3BVZH3SO7/sy1B7SL+MgKHla19FsPx9ruu7pQ/9hjodFXX82bMhkCqQgwIDtcSoH26iXRCi2hT4s64nZ8CR6xa8F+bIDmbmpRGvin2kWB7eAof00ndnr+e866i4ZEMMphw="
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: write_registry
value_before_type_cast: false
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: read_package_registry
value_before_type_cast: true
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: write_package_registry
value_before_type_cast: true
- !ruby/object:ActiveModel::Attribute::FromDatabase
name: creator_id
new_record: false
active_record_yaml_version: 2
:target_id: 111
:target_type: Project
:target_details: group1/project1
bundle exec rspec './spec/requests/api/composer_packages_spec.rb[1:6:1:3:19:1:1:1:1:1]'
ActiveModel::Attribute::FromDatabase
is a private constant, so I'm not sure if this was intended.
https://github.com/rails/rails/issues/45609 is an upstream issue raising this as a possible issue.
https://stackoverflow.com/questions/54012348/how-do-i-load-this-yml-file-in-rails says this was the artifact of ActiveModel::AttributeSet::YAMLEncoder
.
Edited by Stan Hu