Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
unidom-contact-china
Advanced tools
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The China Contact domain model engine includes China Mobile Phone Number and its relative models. Unidom (统一领域对象模型)是一系列的领域模型引擎。中国行政区划领域模型引擎包括中国大陆的手机号码及其相关的模型。
Check out the Road Map to find out what's the next. Check out the Change Log to find out what's new.
gem 'unidom-contact-china'
rake db:migrate
The migration versions start with 2001039156.
phone_number = Unidom::Contact::China::MobilePhoneNumber.new phone_number: '13912345678'
phone_number.save!
Unidom::Contact::China::MobilePhoneNumber.valid_at.alive.first
# Find the first active China mobile phone number
Unidom::Contact::China::MobilePhoneNumber.phone_number_is('13912345678').first
# Find the mobile phone number per the given phone number.
include Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber
The As Mobile Phone Number Subscriber concern do the following tasks for the includer automatically:
has_many :china_mobile_phone_numbers, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::China::MobilePhoneNumber'
If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
# config/initializers/unidom.rb
Unidom::Common.configure do |options|
options[:neglected_namespaces] = %w{
Unidom::Contact::China
}
end
# spec/models/unidom_spec.rb
require 'unidom/contact/china/models_rspec'
# spec/types/unidom_spec.rb
require 'unidom/contact/china/types_rspec'
# spec/validators/unidom_spec.rb
require 'unidom/contact/china/validators_rspec'
# lib/unidom.rb
def initialize_unidom
Unidom::Party::Person.class_eval do
include Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber
end
end
# spec/rails_helper.rb
require 'unidom'
initialize_unidom
# spec/support/unidom_rspec_shared_examples.rb
require 'unidom/contact/china/rspec_shared_examples'
# spec/models/unidom/party/person_spec.rb
describe Unidom::Party::Person, type: :model do
model_attribtues = {
name: 'Tim'
}
it_behaves_like 'Unidom::Contact::China::Concerns::AsMobilePhoneNumberSubscriber', model_attribtues
end
FAQs
Unknown package
We found that unidom-contact-china demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.