@spinajs/rbac
Advanced tools
Comparing version 1.2.135 to 1.2.136
@@ -16,3 +16,3 @@ "use strict"; | ||
const di_1 = require("@spinajs/di"); | ||
class SimpleDbAuthProvider { | ||
let SimpleDbAuthProvider = class SimpleDbAuthProvider { | ||
async exists(user) { | ||
@@ -42,3 +42,3 @@ const result = await User_1.User.where('Email', user instanceof User_1.User ? user.Email : user).first(); | ||
} | ||
} | ||
}; | ||
__decorate([ | ||
@@ -48,3 +48,6 @@ (0, di_1.Autoinject)(di_1.Container), | ||
], SimpleDbAuthProvider.prototype, "Container", void 0); | ||
SimpleDbAuthProvider = __decorate([ | ||
(0, di_1.Injectable)(interfaces_1.AuthProvider) | ||
], SimpleDbAuthProvider); | ||
exports.SimpleDbAuthProvider = SimpleDbAuthProvider; | ||
//# sourceMappingURL=auth.js.map |
import { Bootstrapper } from '@spinajs/di'; | ||
import './auth'; | ||
import './password'; | ||
import './session'; | ||
export * from './interfaces'; | ||
@@ -3,0 +6,0 @@ export * from './auth'; |
@@ -25,6 +25,5 @@ "use strict"; | ||
const di_1 = require("@spinajs/di"); | ||
const auth_1 = require("./auth"); | ||
const interfaces_1 = require("./interfaces"); | ||
const password_1 = require("./password"); | ||
const session_1 = require("./session"); | ||
require("./auth"); | ||
require("./password"); | ||
require("./session"); | ||
const accesscontrol_1 = require("accesscontrol"); | ||
@@ -41,5 +40,2 @@ __exportStar(require("./interfaces"), exports); | ||
bootstrap() { | ||
di_1.DI.register(password_1.BasicPasswordProvider).as(interfaces_1.PasswordProvider); | ||
di_1.DI.register(auth_1.SimpleDbAuthProvider).as(interfaces_1.AuthProvider); | ||
di_1.DI.register(session_1.MemorySessionProvider).as(interfaces_1.SessionProvider); | ||
const ac = new accesscontrol_1.AccessControl(); | ||
@@ -46,0 +42,0 @@ di_1.DI.register(ac).as('AccessControl'); |
@@ -18,2 +18,8 @@ "use strict"; | ||
}); | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
@@ -28,9 +34,11 @@ if (mod && mod.__esModule) return mod; | ||
exports.BasicPasswordProvider = void 0; | ||
const interfaces_1 = require("./interfaces"); | ||
// tslint:disable-next-line: no-var-requires | ||
const { Entropy, charset32 } = require('entropy-string'); | ||
const argon = __importStar(require("argon2")); | ||
const di_1 = require("@spinajs/di"); | ||
/** | ||
* Simple password service that use argon2 hash alghoritm and entropy-string to generate password | ||
*/ | ||
class BasicPasswordProvider { | ||
let BasicPasswordProvider = class BasicPasswordProvider { | ||
async hash(input) { | ||
@@ -55,4 +63,7 @@ // uses default argon settings, no need to tweak | ||
} | ||
} | ||
}; | ||
BasicPasswordProvider = __decorate([ | ||
(0, di_1.Injectable)(interfaces_1.PasswordProvider) | ||
], BasicPasswordProvider); | ||
exports.BasicPasswordProvider = BasicPasswordProvider; | ||
//# sourceMappingURL=password.js.map |
@@ -24,3 +24,3 @@ import { DateTime } from 'luxon'; | ||
*/ | ||
export declare class MemorySessionProvider<T = UserSession> extends SessionProvider<T> { | ||
export declare class MemorySessionStore<T = UserSession> extends SessionProvider<T> { | ||
protected Configuration: Configuration; | ||
@@ -27,0 +27,0 @@ protected Sessions: Map<string, UserSession>; |
@@ -12,3 +12,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MemorySessionProvider = exports.Session = void 0; | ||
exports.MemorySessionStore = exports.Session = void 0; | ||
const luxon_1 = require("luxon"); | ||
@@ -59,3 +59,3 @@ const interfaces_1 = require("./interfaces"); | ||
*/ | ||
class MemorySessionProvider extends interfaces_1.SessionProvider { | ||
let MemorySessionStore = class MemorySessionStore extends interfaces_1.SessionProvider { | ||
constructor() { | ||
@@ -92,8 +92,11 @@ super(...arguments); | ||
} | ||
} | ||
}; | ||
__decorate([ | ||
(0, di_1.Autoinject)(), | ||
__metadata("design:type", configuration_1.Configuration) | ||
], MemorySessionProvider.prototype, "Configuration", void 0); | ||
exports.MemorySessionProvider = MemorySessionProvider; | ||
], MemorySessionStore.prototype, "Configuration", void 0); | ||
MemorySessionStore = __decorate([ | ||
(0, di_1.Injectable)(interfaces_1.SessionProvider) | ||
], MemorySessionStore); | ||
exports.MemorySessionStore = MemorySessionStore; | ||
//# sourceMappingURL=session.js.map |
{ | ||
"name": "@spinajs/rbac", | ||
"version": "1.2.135", | ||
"version": "1.2.136", | ||
"description": "Role and Attribute based Access Control for SpinaJS framework", | ||
@@ -57,3 +57,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "8a7fde1b1fbada9c1b6fb65603ba1aadd5bb1126" | ||
"gitHead": "b29d5f56eaa9b22235759880735d4c2c61362ef6" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35182
634