Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Needs an valid merchant ApiKey
Needs header Authorization: Bearer <APIKEY>
Needs header Oyst-Authorization: Oyst <DATA>
Where <DATA>
is a base64
encoded stringified
object
{
"m": "<MERCHANT_ID>",
"t": "<MERCHANT_TOKEN>" // Generated by `POST` /orders/authorize
}
Needs header oyst-session
Returns a 403
if header is not present
When calling this API except for internal errors, the API should return a json
{
"success": false,
"error": {
"status": "<API-SHORT-CODE>-<ERROR-CODE>",
"status_text": "<ERROR-MSG-USING-i18n>"
}
}
POST
/orders/authorizeHandle the server to server authentication for the oneclick. This route should be called by the merchant during the function getOneclickUrl()
.
The iframe url is returned.
Joi.object({
product_reference: Joi.string().required(),
variation_reference: Joi.string().optional(),
user: Joi.object().optional(),
quantity: Joi.number().integer().default(1)
})
403
on authentication failure{
"success": true,
"url": "http://url_to_front_application"
}
GET
/versionInformations are in package.json
{
"name": "APPLICATION_NAME",
"version": "APPLICATION_VERSION"
}
POST
/ordersHandle the order creation when user is known.
It calls:
Joi.object({
encrypted_card: Joi.string().required()
}).allow(null)
encrypted_card
should be send only when user changes his card
{
"success": true,
"id": "ORDER_UUID",
"product": {},
"user": {},
"order": {}
}
DELETE
/orders/{:id}Delete specific order and clean associated session
It calls:
Joi.object({
id: Joi.string().guid().required()
})
{
"success": true
}
GET
/usersCheck if user exists using the phone number. If found, sms is send with a link
Joi.object({
phone: phoneRule.phone().mobile().required()
})
Where phoneRule
is the npm package joi-phone-validator
{
"success": true, // When user is found or false otherwhise
"sms": true, // Or false if sms was not send
"channel": "PUSHER_CHANNEL_TO_LISTEN_TO",
"event": "PUSHER_EVENT_TO_LISTEN_TO",
"phone": "+33601020304",
"can_retry": true // false if limit is reached
}
POST
/users/cardCalled when user is not found. Store the encrypted_card
in REDIS Session.
Then send a SMS with a link that display a code. Like 3DS
Joi.object({
encrypted_card: Joi.string().required()
})
{
"success": true, // Or false if sms was not send
"channel": "PUSHER_CHANNEL_TO_LISTEN_TO",
"event": "PUSHER_EVENT_TO_LISTEN_TO",
"phone": "+33601020304",
"can_retry": true, // false if limit is reached
"code": true
}
GET
/users/phone/mfaActivate the code when user clicked on the SMS link
Joi.object({
id: Joi.string().guid().required(),
p: phoneRule.phone().mobile().required()
})
Where phoneRule
is the npm package joi-phone-validator
Redirects to ${DISPLAY_CODE_URL}?${Querystring.stringify({ id, phone: p })}
where DISPLAY_CODE_URL
is the url of the ReactAPP to display the code on mobile
POST
/users/phone/validActivate the phone when user clicked on the SMS link. Send PUSHER_EVENT
on success.
PhoneSession
PhoneChecker
Joi.object({
id: Joi.string().guid().required(),
phone: phoneRule.phone().mobile().required(),
session: Joi.string().guid().required(),
user_id: Joi.string().guid().required()
})
Where phoneRule
is the npm package joi-phone-validator
Redirects to PHONE_SUCCESS_URL
that is the static url of success
GET
/mfaPhoneChecker
PUSHER_EVENT
on success with params code: true and uuid
Joi.object({
id: Joi.string().guid().required(),
phone: phoneRule.phone().mobile().required()
})
Where phoneRule
is the npm package joi-phone-validator
{
"code": "SECRET_CODE",
"success": true
}
POST
/mfa/codesPhoneChecker
PUSHER_EVENT
on success with params code: true and uuid
Joi.object({
code: Joi.string().required(),
uuid: Joi.string().guid().required(),
phone: phoneRule.phone().mobile().required()
})
Where phoneRule
is the npm package joi-phone-validator
{
"success": true,
"can_retry": true // or false when success is false
}
POST
/usersJoi.object({
address: address.required(),
billing_address: address.default(Joi.ref('address')),
email: Joi.string().email().required(),
first_name: Joi.string().required(),
language: Joi.string().length(2).optional(),
last_name: Joi.string().required()
})
where address
is
Joi.object({
city: Joi.string().required(),
company_name: allowEmpty,
complementary: allowEmpty,
country: Joi.string().required(),
first_name: Joi.string().required(),
label: Joi.string().required(),
last_name: Joi.string().required(),
postcode: allowEmpty,
region: allowEmpty,
street: Joi.string().required()
})
and allowEmpty
is
Joi.string().empty('').optional()
Where phoneRule
is the npm package joi-phone-validator
{
"success": true,
"user": {}
}
POST
/notificationsFor now notification are not treated this is only usefull for the payment-api not to crashed
TO FIX when order-api will be able to handle payment informations
Joi.object({
live: Joi.boolean().required(),
notification: Joi.object().keys({
additional_data: Joi.object().optional(),
amount: Joi.object().keys({
currency: Joi.string().required(),
value: Joi.number().required()
}).required(),
event_code: Joi.string().required(),
event_date: Joi.date(),
is_3d: Joi.boolean().required(),
operations: Joi.array().items(Joi.string()).required(),
order_id: Joi.string().required(),
payment_id: Joi.string().guid().required(),
success: Joi.boolean().required(),
}).required()
})
OK
FAQs
API to handle 1click button
The npm package 1click-api receives a total of 7 weekly downloads. As such, 1click-api popularity was classified as not popular.
We found that 1click-api 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.