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

@adonisjs/hash

Package Overview
Dependencies
Maintainers
2
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/hash - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

15

build/adonis-typings/hash.d.ts

@@ -68,2 +68,5 @@ declare module '@ioc:Adonis/Core/Hash' {

* to setup the `HashersList`.
*
* We will remove this later. Make sure all stubs are not using this
* type.
*/

@@ -98,9 +101,5 @@ export type HashDrivers = {

/**
* Piggy back on the driver method when driver exists, otherwise fallback to `never`
*/
export type DriverMethod<T, K extends keyof HashDriverContract> = T extends HashDriverContract ? HashDriverContract[K] : never;
/**
* Hash mananger interface
*/
export interface HashContract<DefaultDriver = HashersList[HashConfig['default']]['implementation']> extends ManagerContract<HashDriverContract, HashDriverContract, {
export interface HashContract extends ManagerContract<HashDriverContract, HashDriverContract, {
[P in keyof HashersList]: HashersList[P]['implementation'];

@@ -111,3 +110,3 @@ }> {

*/
hash(value: string): ReturnType<DriverMethod<DefaultDriver, 'hash'>>;
hash(value: string): ReturnType<HashDriverContract['hash']>;
/**

@@ -117,3 +116,3 @@ * Verify plain value against the hashed value to find if it's

*/
verify(hashedValue: string, plainValue: string): ReturnType<DriverMethod<DefaultDriver, 'verify'>>;
verify(hashedValue: string, plainValue: string): ReturnType<HashDriverContract['verify']>;
/**

@@ -123,3 +122,3 @@ * Check the hash against the current config to find it needs

*/
needsReHash(hashedValue: string): ReturnType<DriverMethod<DefaultDriver, 'needsReHash'>>;
needsReHash(hashedValue: string): ReturnType<HashDriverContract['needsReHash']>;
}

@@ -126,0 +125,0 @@ const Hash: HashContract;

@@ -10,5 +10,9 @@ /// <reference path="../adonis-typings/hash.d.ts" />

[P in keyof HashersList]: HashersList[P]['implementation'];
}> implements HashContract<HashDriverContract> {
}> implements HashContract {
config: Config;
constructor(container: any, config: Config);
/**
* Validate config
*/
private validateConfig;
protected $cacheMappings: boolean;

@@ -15,0 +19,0 @@ /**

@@ -13,2 +13,3 @@ "use strict";

const manager_1 = require("@poppinss/manager");
const utils_1 = require("@poppinss/utils");
/**

@@ -23,4 +24,13 @@ * The Hash module exposes the API to hash values using an underlying

this.$cacheMappings = true;
this.validateConfig();
}
/**
* Validate config
*/
validateConfig() {
const validator = new utils_1.ManagerConfigValidator(this.config, 'hash', 'config/hash');
validator.validateDefault('default');
validator.validateList('list', 'default');
}
/**
* Pulling the default driver name from the user config.

@@ -27,0 +37,0 @@ */

{
"name": "@adonisjs/hash",
"version": "2.0.2",
"version": "2.0.3",
"description": "Multi driver hash module with support for PHC string formats",

@@ -45,3 +45,3 @@ "main": "build/providers/HashProvider",

"@phc/bcrypt": "^1.0.2",
"@types/node": "^13.11.1",
"@types/node": "^13.13.1",
"argon2": "^0.26.2",

@@ -87,3 +87,4 @@ "bcrypt": "^4.0.1",

"@phc/format": "^0.5.0",
"@poppinss/manager": "^2.1.6"
"@poppinss/manager": "^2.1.6",
"@poppinss/utils": "^2.2.6"
},

@@ -90,0 +91,0 @@ "optionalDependencies": {

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