Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gifnoc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gifnoc

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gifnoc

A Ruby Gifnoc client implementation.

Installation

Add this line to your application's Gemfile:

gem 'gifnoc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gifnoc

Usage

You can initialize a new Client for Gifnoc using

client = Gifnoc::Client.new(token: <your_token_secret>, base_url: <gifnoc_server_url>)

The Client has 4 main components:

  • Accounts
  • Namespaces
  • Records
  • Tokens

Accounts

Accounts are the top level entity in Gifnoc. It’s used to isolate different users of the system, making Gifnoc safely multi-tenanted. Only the admin account can perform account operations.

The following operations are supported:

accounts = client.list_accounts # list all accounts, returns an array of Gifnoc::Account
account, account_token = client.create_account # create an account, returns an array with two entries, the Gifnoc::Account, and the associated Gifnoc::Token
account = client.get_account(account_uuid) # get a specific account, returns Gifnoc::Account
client.delete_account(account_uuid) # delete an account

Namespaces

Records are namespaced to allow a degree of separation between different users of the system within a single account. Access to namespaces is not regulated (like accounts).

The following operations are supported:

namespaces = client.list_namespaces # list all namespaces, returns an array of Gifnoc::Namespace
namespace = client.create_namespace(new_namespace) # create a namespace, returns a Gifnoc::Namespace
namespace = client.get_namespace(namespace_uuid) # get a specific namespace, returns Gifnoc::Namespace
namespace = client.update_namespace(namespace_uuid, new_namespace) # update an existing namespace, returns a Gifnoc::Namespace
client.delete_namespace(namespace_uuid) # delete a namespace

Records

A single configuration item. A Record holds the following attributes: key, raw_value, uuid, metadata, created_at, updated_at, last_access. When you create a new instance of Record you can specify the Base64 encoded raw_value directly, or use the value= setter method that will encode the value for you.

The following operations are supported:

records = client.list_records(namespace_uuid) # list all the records of a namespace, returns an array of Gifnoc::Record
record = client.create_record(namespace_uuid, new_record) # create a record inside a namespace, returns a Gifnoc::Record
record = client.get_record(namespace_uuid, record_key) # get a specific record, returns Gifnoc::Record
record = client.update_record(namespace_uuid, record_key, new_record) # update an existing record inside a namespace, returns a Gifnoc::Record
client.delete_record(namespace_uuid, record_key) # delete a record from a namespace

Tokens

Accounts are identified by tokens. An account can have many tokens. Tokens can have expiry dates and are identified with a UUID. Callers to the Gifnoc API will use a token’s secret in the call to identify themselves.

The following operations are supported:

tokens = client.list_tokens # list all tokens, returns an array of Gifnoc::Token
token = client.create_token(new_token) # create a token, returns a Gifnoc::Token
token = client.get_token(token_uuid) # get a specific token, returns Gifnoc::Token
token = client.update_token(token_uuid, new_token) # update an existing token, returns a Gifnoc::Token
client.delete_token(token_uuid) # delete a token

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test 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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/cloud66-oss/gifnoc-ruby.

License

The gem is available as open source under the terms of the Apache 2.0 License.

FAQs

Package last updated on 27 Nov 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc