Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
This is the Ruby client library that wraps the Designer News API. It assumes you have used another oAuth 2 library to obtain and manage a valid access token. It is based on the Ruby gem for the LayerVault API.
Put this in your Gemfile and smoke it:
gem 'dn'
Or install it:
$ gem install dn
Currently only Resource Owner Credentials and Client Credentials are supported.
client_id
and client_secret
.curl -i https://api-news.layervault.com/oauth/token \
-F grant_type="password" \
-F username="<username_goes_here>" \
-F password="<password_goes_here>" \
-F client_id="<client_id_goes_here>" \
-F client_secret="<client_secret_goes_here>"
curl -H 'Authorization: Bearer <your access token>' \
'https://api-news.layervault.com/api/v1/me'
You can initialize the client via Environment Variables or by passing configurations options into the client when you create it, like this:
@client = DesignerNews::Client.new({
access_token: 'your_access_token',
api_endpoint: 'your_api_endpoint'
})
Or you can also say:
DesignerNews.client.access_token = 'access_token'
DesignerNews.client.api_endpoint = 'api_endpoint'
# You Designer News API access token
ENV['DESIGNER_NEWS_ACCESS_TOKEN']
# The API Endpoint you wish to target calls against (defaults to https://api-news.layervault.com/api/v1/)
ENV['DESIGNER_NEWS_API_ENDPOINT']
# Defaults to Designer News Ruby Gem #{DesignerNews::VERSION}
ENV['DESIGNER_NEWS_USER_AGENT']
You should set the User agent to include your email address so that in the event your client does something wrong we can contact you.
You can use the DesignerNews.client.<api_operation>
methods to call the API to perform actions. Alternatively, each API object has simple object model that allows you to say:
DesignerNews.client.access_token = 'access_token'
p = DesignerNews::Organization.for('layervault')
p.create_project('my new project')
And so on.
There's a very simple object model provided by classes that implement Hashie objects that wrap the JSON responses from the DesignerNews.client
interface. The objects mostly all follow a .for
pattern that accepts the appropriate number of arguments for the level of nesting the object represents.
When using the simple object model, associations will be hydrated into the correct child objects for the immediate child relationships only, allowing a simple level of traversal down the object model hierarchy. There is no lazy loding support that will automatically hydrated any deeper associations - you must perform new queries.
Coming soon.
FAQs
Unknown package
We found that dn 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.