Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Install the gem from the command line:
gem install My-first-api-matic -v 1.0
Or add the gem to your Gemfile and run bundle
:
gem 'My-first-api-matic', '1.0'
For additional gem details, see the RubyGems page for the My-first-api-matic gem.
The following parameters are configurable for the API Client:
Parameter | Type | Description |
---|---|---|
timeout | Float | The value to use for connection timeout. Default: 60 |
max_retries | Integer | The number of times to retry an endpoint call if it fails. Default: 0 |
retry_interval | Float | Pause in seconds between retries. Default: 1 |
backoff_factor | Float | The amount to multiply each successive retry's interval amount by in order to provide backoff. Default: 2 |
retry_statuses | Array | A list of HTTP statuses to retry. Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] |
retry_methods | Array | A list of HTTP methods to retry. Default: %i[get put] |
The API client can be initialized as follows:
client = Youtube::Client.new(
)
Here is the list of errors that the API might throw.
HTTP Status Code | Error Description | Exception Class |
---|---|---|
401 | dfgdfgdfgdfgdsfg | ProblemDetailsException |
The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.
Name | Description |
---|---|
api | Gets APIController |
An instance of the APIController
class can be accessed from the API Client.
client_controller = client.client
get list of 5 random forcasts
:information_source: Note This endpoint does not require authentication.
def get_forcast(param: 'String.Empty')
Parameter | Type | Tags | Description |
---|---|---|---|
param | String | Query, Optional | default string parameter Default: 'String.Empty' |
Server::DEFAULT
Mixed
param = 'my value for error'
result = client_controller.get_forcast(param: param)
[
{
"date": "2021-05-27T10:33:06.7728939+05:00",
"temperatureC": -7,
"temperatureF": 20,
"summary": "Scorching"
},
{
"date": "2021-05-28T10:33:06.7729006+05:00",
"temperatureC": 6,
"temperatureF": 42,
"summary": "Bracing"
}
]
HTTP Status Code | Error Description | Exception Class |
---|---|---|
400 | Test error message | ProblemDetailsException |
404 | not found | APIException |
WeatherForecast
Name | Type | Tags | Description |
---|---|---|---|
date | DateTime | Required | The time when forecast was taken |
temperature_c | Integer | Required | the value of temperature in Centigrade |
temperature_f | Integer | Required, Constant | the value of temperature in Fahrenheit |
summary | String | Required, Constant | - |
{
"date": "2021-05-27T10:33:06.7728939+05:00",
"temperatureC": -7,
"temperatureF": 20,
"summary": "Scorching"
}
WeatherForcaseJsonImported
Name | Type | Tags | Description |
---|---|---|---|
date | String | Required | - |
temperature_c | Integer | Required | - |
temperature_f | Integer | Required | - |
summary | String | Required | - |
{
"date": "2021-05-27T10:33:06.7728939+05:00",
"temperatureC": -7,
"temperatureF": 20,
"summary": "Scorching"
}
FieldParameterValidator
Name | Type | Tags | Description |
---|---|---|---|
precision | Float | Required | Constraints: > 0 , < 600 , Multiple Of: 10 , Total Digits: 1000 , Fraction Digits: 2 |
string | Array<String> | Optional, Constant | Constraints: Minimum Items: 5 , Maximum Items: 200 , Minimum Length: 3 , Maximum Length: 10 , Pattern: /^[A-Z]+$/i |
unix_format_date_time | DateTime | Required | - |
object | Object | Required | - |
int_64 | Long | Required | Constraints: > 23 , < 23 , Multiple Of: 3 , Total Digits: 23 , Fraction Digits: 23 , Pattern: 2 |
{
"Precision": 229.08,
"UnixFormatDateTime": 1480809600,
"Object": {
"key1": "val1",
"key2": "val2"
},
"Int64": 10
}
This is the test description of enum00
TestEnum
Name | Description |
---|---|
FIRSTFILED | Test description of first filed |
SECONDFIELD | Test description of Second filed |
THIRD_VALUE |
ProblemDetailsException
Name | Type | Tags | Description |
---|---|---|---|
type | String | Required, Constant | - |
title | String | Required, Constant | - |
status | Integer | Required, Constant | - |
trace_id | String | Required, Constant | - |
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Bad Request",
"status": 400,
"traceId": "00-3dd0a6221d0ccd48ad5eb89a9cf3df71-91763b2e58fa4742-00"
}
API utility class.
Name | Return Type | Description |
---|---|---|
json_deserialize | Hash | Deserializes a JSON string to a Ruby Hash. |
rfc3339 | DateTime | Safely converts a string into an RFC3339 DateTime object. |
Http response received.
Name | Type | Description |
---|---|---|
status_code | Integer | The status code returned by the server. |
reason_phrase | String | The reason phrase returned by the server. |
headers | Hash | Response headers. |
raw_body | String | Response body. |
request | HttpRequest | The request that resulted in this response. |
Represents a single Http Request.
Name | Type | Tag | Description |
---|---|---|---|
http_method | HttpMethodEnum | The HTTP method of the request. | |
query_url | String | The endpoint URL for the API request. | |
headers | Hash | Optional | Request headers. |
parameters | Hash | Optional | Request body. |
FAQs
Unknown package
We found that My-first-api-matic 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.