-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Petr Juna
committed
Nov 13, 2019
1 parent
2cf0587
commit 1b07a27
Showing
11 changed files
with
101 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,6 @@ typings/ | |
# next.js build output | ||
.next | ||
|
||
dist | ||
dist | ||
|
||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
language: node_js | ||
node_js: | ||
- "8" | ||
- "10" | ||
- '8' | ||
- '10' | ||
before_script: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- export DISPLAY=:99.0 | ||
services: | ||
- xvfb | ||
install: | ||
- npm install | ||
- gulp build | ||
- npm install | ||
- gulp build | ||
script: | ||
- npm test | ||
- npm test | ||
after_success: | ||
- npm run test:coverage | ||
- "npm install coveralls && cat ./coverage/lcov.info | coveralls" | ||
- npm run test:coverage | ||
- 'npm install coveralls && cat ./coverage/lcov.info | coveralls' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface ACOptions { | ||
/** | ||
* A name of endpoint which serves grants | ||
*/ | ||
grantsEndpoint?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { DynamicModule, Provider } from '@nestjs/common'; | ||
import { DynamicModule, Type, ForwardReference, Abstract } from '@nestjs/common'; | ||
import { RolesBuilder } from './roles-builder.class'; | ||
import { ACOptions } from './ac-options.interface'; | ||
export declare class AccessControlModule { | ||
/** | ||
* Register a pre-defined roles | ||
* @param {RolesBuilder} roles A list containing the access grant | ||
* @param {ACOptions} options A configurable options | ||
* definitions. See the structure of this object in the examples. | ||
*/ | ||
static forRoles(roles: RolesBuilder): DynamicModule; | ||
static forRoles(roles: RolesBuilder, options?: ACOptions): DynamicModule; | ||
static forRootAsync(options: { | ||
inject?: Provider[]; | ||
useFactory: (...args: any) => RolesBuilder; | ||
imports?: Array<Type<any> | DynamicModule | Promise<DynamicModule> | ForwardReference>; | ||
inject?: Array<Type<any> | string | symbol | Abstract<any> | Function>; | ||
useFactory: (...args: any) => RolesBuilder | Promise<RolesBuilder>; | ||
}): DynamicModule; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { RolesBuilder } from './roles-builder.class'; | ||
export declare class GrantsController { | ||
private readonly roleBuilder; | ||
constructor(roleBuilder: RolesBuilder); | ||
getGrants(): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"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 __metadata = (this && this.__metadata) || function (k, v) { | ||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const common_1 = require("@nestjs/common"); | ||
const inject_roles_builder_decorator_1 = require("./decorators/inject-roles-builder.decorator"); | ||
const roles_builder_class_1 = require("./roles-builder.class"); | ||
let GrantsController = class GrantsController { | ||
constructor(roleBuilder) { | ||
this.roleBuilder = roleBuilder; | ||
} | ||
getGrants() { | ||
return this.roleBuilder.getGrants(); | ||
} | ||
}; | ||
__decorate([ | ||
common_1.Get(), | ||
__metadata("design:type", Function), | ||
__metadata("design:paramtypes", []), | ||
__metadata("design:returntype", void 0) | ||
], GrantsController.prototype, "getGrants", null); | ||
GrantsController = __decorate([ | ||
common_1.Controller(), | ||
__param(0, inject_roles_builder_decorator_1.InjectRolesBuilder()), | ||
__metadata("design:paramtypes", [roles_builder_class_1.RolesBuilder]) | ||
], GrantsController); | ||
exports.GrantsController = GrantsController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters