Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
This gem is used to interact with the Developer Portal REST APIs to perform some of the operations that are normally carried out in the Developer Portal UI.
Add this line to your application's Gemfile:
gem 'api_connect_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install api_connect_client
The Developer Portal REST APIs requires you to define a context with the form of organization.space
where lives the catalog you are trying to interact with. In order to configure this gem you need to register the context:
ApiConnectClient::Config.register_context("your_bluemix_context")
In rails you can create an initializer in config/initializers (e.g. api_connect_client.rb) and define your context.
The endpoint used to interact with this APIs is https://us.apiconnect.ibmcloud.com/v1/portal
You can also register a custom endpoint like this:
ApiConnectClient::Config.register_endpoint("your_custom_endpoint")
Once you have configured your context you can interact with the APIs in two different ways:
Manager:
Developer:
To interact as a manager you need to initialize it like this:
manager = ApiConnectClient::Manager.new('manager_email', 'manager_password')
Then with the manager
you can create a new user:
manager.create_user(first_name, last_name, organization_name, username, password)
To list public products:
manager.list_products
Which will return an array with the public products of your catalog with the following structure:
[
{
"id": "5a0333569cf1b5ba87c1fd2f",
"info": {
"name": "product_name",
"title": "Product Title",
"version": "1.0.1",
"description": "Product description"
},
"url": "https://us.apiconnect.ibmcloud.com/v1/portal/products/5a0333569cf1b5ba87c1fd2f",
"status": "published"
},
{
"id": "5a0333569cf1b5ba87c1fd2a",
"info": {
"name": "product_name",
"title": "Product Title",
"version": "1.0.1",
"description": "Product description",
"categories": [
"mock"
]
},
"url": "https://us.apiconnect.ibmcloud.com/v1/portal/products/5a0333569cf1b5ba87c1fd2a",
"status": "published"
}
]
If you want to retrieve an specific product you can call:
manager.show_product(product_id)
To interact as a developer you need to initialize it like this:
developer = ApiConnectClient::Developer.new('developer_email', 'developer_password', 'organization_id')
Then with the developer
you can create a new application:
developer.create_application(name, description, oauth_redirect_url, public_app = false)
List the applications owned by the developer:
developer.list_applications
developer.show_application(app_id)
developer.update_application(app_id, name, description, oauth_redirect_uri, public_app)
developer.update_application_credentials(app_id, client_id, client_secret)
developer.subscribe_application(app_id, product_id, plan = 'default')
api.list_public_apis
api.get_swagger_from_public_api "5a956c490cf23b2cf8eacfbe"
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
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/[USERNAME]/api-connect-client.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that api_connect_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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.