Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Bliss API Ruby client.
Add this line to your application's Gemfile:
gem 'bliss-client', git: 'git@github.com:fadendaten/bliss-client.git', tag: 'v1.2.0'
And then execute:
bundle
The client requires the following environment variables to be set:
BLISS_SERVER=http://sv96.aarboard.ch
BLISS_CLIENT_ID=34osdljwosdf...
BLISS_CLIENT_SECRET=24ljsdfo8t34...
order = Bliss::Client::Order.create(
type: :webshop,
blizzard_customer_id: 4,
items: [
{
article_id: 3456, # Bliss article id
quantity: 2,
price_value: 35.20,
price_currency: 'CHF'
},
{
article_id: 18462,
quantity: 1,
price_value: 120,
price_currency: 'CHF'
}
],
delivery_address: {
salutation: 'Mr Spongebob Squarepants',
line_1: 'Ananas 3', # optionally pass line_2 and line_3
zip_code: '12345',
city: 'Bikini Bottom',
country_iso3: 'USA'
},
remote_id: 234, # the id of the local Webshop order
)
order.id # => id of the Bliss Webshop order
Collections and their children model the product catalogue of NILE. The
Bliss::Client::Collection
provides a way to fetch that data.
.all
collections = Bliss::Client::Collection.all
This can be useful for fetching all basic information quickly and then use the
IDs of some collections to get more info via .find
(see below).
.find
ids = [88, 90, 91, 21]
collections = Bliss::Client::Collection.find ids
include_<whatever>
optionsids = [88, 90, 91, 21]
collections = Bliss::Client::Collection.find(
ids,
include_programs: true,
include_styles: true,
include_articles: true
)
collections.each do |collection|
# Access programs with Collection#programs.
collection.programs.each do |program|
# Access styles with Program#styles.
program.styles # ...
end
end
# Make sure we know about all sizes
Bliss::Client::Size.all.each { # create size options type }
# Say webshop4 needs to know about collection 88, 89 and 90.
collection_ids = [88, 89, 90]
# We want EVERYTHING!!
options = {
include_programs: true,
include_colors: true,
include_styles: true,
include_articles: true,
include_prices: true
}
collections = Bliss::Client::Collection.find(collection_ids, options)
# Traverse the structure with #each and do whatever you want, e.g.
collections.each do |collection|
collection.keylooks.each { # create keylook (aka weblook) }
collection.studiolooks.each { # create studiolook }
collection.programs.each do |program|
program.colors.each { # create options types }
program.styles.each do |styles|
styles.each do |style|
# create product
style.articles.each do |article|
# create product variant
# NOTE: that this will return the article ID blizzard is interested in
article.legacy_id
end
# access prices
[:chf, :eur].each do |currency|
# current prices (may be reduced)
style.sales_price(currency)
style.purchase_price(currency)
# original prices (non-reduced)
style.original_sales_price(currency)
style.original_purchase_price(currency)
# find out whether the style is discounted, i.e. sold at a reduced
# price
style.discounted?(currency)
end
end
end
end
end
To install the dependencies and setup config files:
bin/setup
To run the tests:
rake
To see faraday output while running tests:
BLISS_CLIENT_DEBUG=true rake
For an interactive prompt:
bin/console
To install this gem onto your local machine, run bundle exec rake install
. To
release a new version, update the version number in version.rb
, and then run
bundle exec rake release
, which will create a git tag for the version, push
git commits and tags, and push the .gem
file to
rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/fadendaten/bliss-client.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that bliss-client 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.