
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
activeldap-fabrication
Advanced tools
h1. ActiveLdap Fabrication
"ActiveLdap":http://ruby-activeldap.rubyforge.org/ adapter for "Fabrication":http://fabricationgem.org/.
h2. Description
'ActiveLdap Fabrication' is an ActiveLdap adapter for Fabrication. It means that you can use Fabrication as fixture replacement for ActiveLdap.
h2. Requirements
h2. Install
Here are install steps for Rails 3:
Gemfile:
group :development, :test do # ... gem "activeldap-fabrication" # <- Add this. end
config/application.rb:
config.generators do |g| # For test-unit g.test_framework :test_unit, :fixture => true, :fixture_replacement => "fabrication" g.fixture_replacement :fabrication, :dir => "test/fabricators" # For RSpec # g.test_framework :rspec, :fixture => true, :fixture_replacement => "fabrication" # g.fixture_replacement :fabrication end
test/test_helper.rb:
ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require "active_ldap_fabrication" # <- Add this. class ActiveSupport::TestCase # Add more helper methods to be used by all tests here... # LDAP: start setup do @dumped_data = nil begin @dumped_data = ActiveLdap::Base.dump(:scope => :sub) rescue ActiveLdap::ConnectionError end ActiveLdap::Base.delete_all(nil, :scope => :sub) populate_ldap end teardown do if @dumped_data ActiveLdap::Base.setup_connection ActiveLdap::Base.delete_all(nil, :scope => :sub) ActiveLdap::Base.load(@dumped_data) end end def populate_ldap populate_ldap_base populate_ldap_ou end def populate_ldap_base ActiveLdap::Populate.ensure_base end def populate_ldap_ou end # LDAP: end end
h2. Usage
We generate User model:
% script/rails generate model User --classes person
We populate ou=Users on setup in test/test_helper.rb:
# ... class ActiveSupport::TestCase # ... def populate_ldap_ou ActiveLdap::Populate.ensure_ou("Users") # <- Add this. end end
We define test data in test/fabricators/user_fabricator.rb:
Fabricator(:user) do end Fabricator(:bob, :from => :user) do cn "Bob" sn "Dyran" end
We add a test for User model in test/unit/user_test.rb:
require 'test_helper' class UserTest < ActiveSupport::TestCase test "cn" do assert_equal("Bob", Fabricate(:bob).cn) end end
We run tests:
% bundle exec rake test Loaded suite /var/lib/gems/1.9.1/gems/rake-0.9.2/lib/rake/rake_test_loader Started UserTest: PASS cn (1.10s) Finished in 1.101005 seconds. 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
h2. Author
h2. Licence
This program is free software; you can redistribute it and/or modify it. It is dual licensed under Ruby's license and under the terms of the Lesser GNU General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version.
Please see the file COPYING for the terms of the licence.
h2. Thanks
FAQs
Unknown package
We found that activeldap-fabrication 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.