New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

multicolour-hapi-jsonapi

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multicolour-hapi-jsonapi - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

30

index.js

@@ -67,2 +67,30 @@ "use strict"

/**
* Get any auth configuration
* @param {Waterline.Collection} Collection to get auth roles from.
* @param {String|Boolean} Name of the auth strategy to use or false.
* @return {Object|Boolean} Auth will be false if none, otherwise an object.
*/
get_auth_config(model, auth_strategy_name) {
if (!auth_strategy_name) {
return false
}
// If there's a specific role object
// for this verb, set it.
if (model.roles) {
return {
strategy: auth_strategy_name,
scope: model.roles.get || model.roles
}
}
// Otherwise, just use the defaults.
else {
return {
strategy: auth_strategy_name,
scope: ["user", "admin", "consumer"]
}
}
}
generate_related_resource_routes(server, multicolour) {

@@ -111,3 +139,3 @@ // Get the collections.

config: {
// auth: this.get_auth_config(),
auth: this.get_auth_config(model, multicolour.get("server").request("auth_config")),
handler: (request, reply) => {

@@ -114,0 +142,0 @@ // Merge the params into the query string params.

2

package.json
{
"name": "multicolour-hapi-jsonapi",
"version": "0.2.1",
"version": "0.2.2",
"description": "JSON API reply decorator built on Waterline and waterline-jsonapi",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,3 +21,7 @@ "use strict"

}
},
roles: {
get: ["user"]
}
}
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