
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
example_fdhbiopcnmeocbr_gem_misc
Advanced tools
AuditApi - the Ruby gem for the Audit Log API
The Audit Logs API lets you read audit log entries and track API calls or activities in the Bare Metal Cloud Portal.
Knowledge base articles to help you can be found
here
All URLs are relative to (https://api.phoenixnap.com/audit/v1/)
This SDK is automatically generated by the OpenAPI Generator project:
To build the Ruby code into a gem:
gem build pnap_audit_api.gemspec
Then either install the gem locally, replacing <VERSION>
with the actual version:
gem install ./pnap_audit_api-<VERSION>.gem
(for development, run gem install --dev ./pnap_audit_api-<VERSION>.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'pnap_audit_api', '~> <VERSION>'
To install this Gem from this repository, you'll need to get Bundler by doing gem install bundler
. Add the following line in your Gemfile:
gem 'pnap_audit_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'AuditApi/*.gemspec'
If you'd like the development version:
gem 'pnap_audit_api', git: 'https://github.com/phoenixnap/ruby-sdk-bmc-poc', glob: 'AuditApi/*.gemspec', branch: 'develop'
Then run bundle install
.
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'pnap_audit_api'
# Setup authorization
AuditApi.configure do |config|
# Configure OAuth2 access token for authorization: OAuth2
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = AuditApi::EventsApi.new
opts = {
from: Time.parse('2021-04-27T16:24:57.123Z'), # Time | From the date and time (inclusive) to filter event log records by.
to: Time.parse('2021-04-29T16:24:57.123Z'), # Time | To the date and time (inclusive) to filter event log records by.
limit: 10, # Integer | Limit the number of records returned.
order: 'ASC', # String | Ordering of the event's time. SortBy can be introduced later on.
username: 'johnd@phoenixnap.com', # String | The username that did the actions.
verb: 'POST', # String | The HTTP verb corresponding to the action.
uri: '/ams/v1/clients/12345' # String | The request uri.
}
begin
#List event logs.
result = api_instance.events_get(opts)
p result
rescue AuditApi::ApiError => e
puts "Exception when calling EventsApi->events_get: #{e}"
end
Authorization can also be setup by using the oauth
library:
# Load the gem
require 'pnap_audit_api'
require 'oauth2'
# Setup variables for getting a token.
client_id = 'YOUR_CLIENT_ID'
client_secret = 'YOUR_CLIENT_SECRET'
auth_url = 'https://auth.phoenixnap.com/auth/realms/BMC/protocol/openid-connect/token'
# Setup authorization
AuditApi.configure do |config|
# Retrieve the token using OAuth2.
client = OAuth2::Client.new(client_id, client_secret, token_url: auth_url)
token = client.client_credentials.get_token
# Configure OAuth2 access token for authorization: OAuth2
config.access_token = token.token
end
All URIs are relative to https://api.phoenixnap.com/audit/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AuditApi::EventsApi | events_get | GET /events | List event logs. |
FAQs
Unknown package
We found that example_fdhbiopcnmeocbr_gem_misc 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
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
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.