-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
193 changed files
with
1,249 additions
and
2,557 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-123 KB
.yarn/cache/@apollo-query-planner-npm-0.2.3-66297845b0-6bb0d5833d.zip
Binary file not shown.
Binary file removed
BIN
-85.2 KB
.yarn/cache/@apollo-usage-reporting-protobuf-npm-4.1.1-e619ee6cb3-7b6ed9cd6a.zip
Binary file not shown.
Binary file removed
BIN
-5.45 KB
.yarn/cache/@apollo-utils.dropunuseddefinitions-npm-1.1.0-82863788ff-a2f8ba344e.zip
Binary file not shown.
Binary file removed
BIN
-18.2 KB
.yarn/cache/@apollo-utils.keyvaluecache-npm-1.0.2-9e950d6185-6632645b24.zip
Binary file not shown.
Binary file removed
BIN
-5.51 KB
.yarn/cache/@apollo-utils.logger-npm-1.0.1-b36828a837-c422ac921b.zip
Binary file not shown.
Binary file removed
BIN
-6.19 KB
.yarn/cache/@apollo-utils.printwithreducedwhitespace-npm-1.1.0-9142d379e6-8a9f627de3.zip
Binary file not shown.
Binary file removed
BIN
-5.47 KB
.yarn/cache/@apollo-utils.removealiases-npm-1.0.0-f392722bde-859e33e457.zip
Binary file not shown.
Binary file removed
BIN
-5.09 KB
.yarn/cache/@apollo-utils.sortast-npm-1.1.0-4794e294d1-6ed02f9bf6.zip
Binary file not shown.
Binary file removed
BIN
-6.09 KB
.yarn/cache/@apollo-utils.stripsensitiveliterals-npm-1.2.0-a837e57dac-8159a4c36e.zip
Binary file not shown.
Binary file removed
BIN
-15.2 KB
.yarn/cache/@apollo-utils.usagereporting-npm-1.0.1-dce7e9e883-cbe691c1b8.zip
Binary file not shown.
Binary file removed
BIN
-31.6 KB
.yarn/cache/@apollographql-apollo-tools-npm-0.5.4-61303be2a9-3cef33d96c.zip
Binary file not shown.
Binary file removed
BIN
-17.4 KB
.yarn/cache/@ardatan-aggregate-error-npm-0.0.6-0f1d22ed0c-203e254952.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-134 KB
.yarn/cache/@graphql-tools-merge-npm-6.2.14-5b9e215cc7-4be40aa42c.zip
Binary file not shown.
Binary file removed
BIN
-92.9 KB
.yarn/cache/@graphql-tools-schema-npm-7.1.5-8ccd3263e7-17e7ec8fb8.zip
Binary file not shown.
Binary file removed
BIN
-162 KB
.yarn/cache/@graphql-tools-utils-npm-10.0.0-89c947f78b-91df8f24a1.zip
Binary file not shown.
Binary file removed
BIN
-401 KB
.yarn/cache/@graphql-tools-utils-npm-7.10.0-475b037855-c80b4866d0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-12.7 KB
.yarn/cache/@nestjs-mapped-types-npm-0.4.1-29e5471964-818d5a8485.zip
Binary file not shown.
Binary file removed
BIN
-13.5 KB
.yarn/cache/@nestjs-mapped-types-npm-1.2.2-879ac81dac-b4cb4c28ea.zip
Binary file not shown.
Binary file removed
BIN
-169 KB
.yarn/cache/@nestjs-microservices-npm-10.1.3-6c6fa278f9-e156e15c73.zip
Binary file not shown.
Binary file removed
BIN
-169 KB
.yarn/cache/@nestjs-microservices-npm-10.2.1-62ee29aaad-3402cd1351.zip
Binary file not shown.
Binary file removed
BIN
-155 KB
.yarn/cache/@nestjs-microservices-npm-8.0.5-c1b1ee14bd-a3302fa9db.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-176 KB
.yarn/cache/@oryd-keto-client-npm-0.5.6-alpha.1-98dd6315f3-fe7855a018.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.55 KB
.yarn/cache/@types-tough-cookie-npm-4.0.1-3e523463ac-82906e88f7.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-48.7 KB
.yarn/cache/apollo-reporting-protobuf-npm-3.4.0-17f79d966b-ccaacf1423.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-16.2 KB
.yarn/cache/apollo-server-env-npm-3.2.0-rc.0-031066cfd1-af4228daaa.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-6.3 KB
.yarn/cache/apollo-server-plugin-base-npm-3.7.2-973c53115d-c24b296f31.zip
Binary file not shown.
Binary file removed
BIN
-35.5 KB
.yarn/cache/apollo-server-testing-npm-2.25.2-85a171c5be-8bafae85be.zip
Binary file not shown.
Binary file removed
BIN
-9.99 KB
.yarn/cache/apollo-server-types-npm-3.8.0-b8513032b3-3d642fb83f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-8.2 KB
.yarn/cache/babel-plugin-transform-es2015-block-scoping-npm-6.26.0-e105a6ceb3-406255c6ec.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-9.31 KB
.yarn/cache/node-abort-controller-npm-3.1.1-e246ed42cd-08f22d97b6.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-8.97 KB
.yarn/cache/regenerator-runtime-npm-0.11.1-a31e4f8dcd-14664043fb.zip
Binary file not shown.
Binary file removed
BIN
-13.9 KB
.yarn/cache/regexp.prototype.flags-npm-1.3.1-f0c34f894f-764bd6e49c.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-25.5 KB
.yarn/cache/source-map-support-npm-0.4.18-cf66202fc8-a2d71e33f3.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
2 changes: 1 addition & 1 deletion
2
packages/dataloader/src/interfaces/nest-dataloader.interfaces.ts
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,5 +1,5 @@ | ||
import DataLoader from 'dataloader' | ||
|
||
export interface NestDataLoader { | ||
generateDataLoader(): DataLoader<any,any> | ||
generateDataLoader(): DataLoader<any, 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from './guarded-by-keto.decorator' | ||
export { GuardedByKetoFunction } from './guarded-by-keto.interfaces' | ||
export * from './guarded-by-keto.decorator' | ||
export { GuardedByKetoFunction } from './guarded-by-keto.interfaces' | ||
export { GetGuardingRelationTuple } from './guarded-by-keto.interfaces' | ||
export { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants' | ||
export { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants' | ||
export { getGuardingRelationTuple } from './get-guarding-relation.helper' |
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 @@ | ||
export * from './keto-integration.module' |
21 changes: 21 additions & 0 deletions
21
packages/keto/integration/src/keto-integration.controller.ts
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,21 @@ | ||
import { UseGuards } from '@nestjs/common' | ||
import { Controller } from '@nestjs/common' | ||
import { Get } from '@nestjs/common' | ||
|
||
import { GuardedByKeto } from '../../src' | ||
import { KetoGuard } from '../../src' | ||
|
||
@Controller() | ||
export class KetoIntegrationController { | ||
@Get('/allowed') | ||
async allow() { | ||
return true | ||
} | ||
|
||
@Get('/protected-by-keto') | ||
@GuardedByKeto((user) => `Group:admin#members@${user}`) | ||
@UseGuards(KetoGuard) | ||
async protect() { | ||
return 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Module } from '@nestjs/common' | ||
|
||
import { KetoModule } from '../../src' | ||
import { KetoIntegrationController } from './keto-integration.controller' | ||
|
||
@Module({ | ||
imports: [ | ||
KetoModule.register({ | ||
basePath: '127.0.0.1:4466', | ||
}), | ||
], | ||
controllers: [KetoIntegrationController], | ||
}) | ||
export class KetoIntegrationModule {} |
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,95 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import { INestApplication } from '@nestjs/common' | ||
import { TestingModule } from '@nestjs/testing' | ||
import { Test } from '@nestjs/testing' | ||
|
||
import request from 'supertest' | ||
import { log } from 'testcontainers' | ||
import { Network } from 'testcontainers' | ||
Check failure on line 11 in packages/keto/integration/test/client-read.test.ts GitHub Actions / Lint(@typescript-eslint/no-unused-vars): 'log' is defined but never used.
Raw output
|
||
import { Wait } from 'testcontainers' | ||
import { StartedTestContainer } from 'testcontainers' | ||
import { GenericContainer } from 'testcontainers' | ||
|
||
import { KETO_MODULE_CONFIGURATION } from '../../src' | ||
import { KetoIntegrationModule } from '../src' | ||
import { KETO_WRITE_PORT } from './test.constants' | ||
import { KETO_READ_PORT } from './test.constants' | ||
import { APP_PORT } from './test.constants' | ||
import { KETO_FILES } from './test.constants' | ||
import { KETO_ENVIRONMENT } from './test.constants' | ||
import { DB_PORT } from './test.constants' | ||
import { DB_ENVIRONMENT } from './test.constants' | ||
import { KETO_START_COMMAND } from './test.constants' | ||
import { KETO_INIT_COMMAND } from './test.constants' | ||
import { KETO_MIGRATE_COMMAND } from './test.constants' | ||
|
||
jest.setTimeout(15000) | ||
|
||
describe('Keto read client', () => { | ||
let app: INestApplication | ||
let url: string | ||
let module: TestingModule | ||
|
||
let dbContainer: StartedTestContainer | ||
let ketoContainer: StartedTestContainer | ||
|
||
beforeAll(async () => { | ||
const network = await new Network().start() | ||
|
||
dbContainer = await new GenericContainer('bitnami/postgresql') | ||
.withWaitStrategy(Wait.forLogMessage('database system is ready to accept connections')) | ||
.withEnvironment(DB_ENVIRONMENT) | ||
.withNetwork(network) | ||
.withNetworkAliases('db') | ||
.withExposedPorts(DB_PORT) | ||
.start() | ||
|
||
await new GenericContainer('oryd/keto') | ||
.withEnvironment(KETO_ENVIRONMENT) | ||
.withCopyFilesToContainer(KETO_FILES) | ||
.withNetwork(network) | ||
.withCommand(KETO_MIGRATE_COMMAND) | ||
.start() | ||
|
||
ketoContainer = await new GenericContainer('oryd/keto') | ||
.withEnvironment(KETO_ENVIRONMENT) | ||
.withCopyFilesToContainer(KETO_FILES) | ||
.withNetwork(network) | ||
.withExposedPorts(KETO_READ_PORT, KETO_WRITE_PORT) | ||
.withCommand(KETO_START_COMMAND) | ||
.start() | ||
|
||
await ketoContainer.exec(KETO_INIT_COMMAND) | ||
|
||
module = await Test.createTestingModule({ | ||
imports: [KetoIntegrationModule], | ||
}) | ||
.overrideProvider(KETO_MODULE_CONFIGURATION) | ||
.useValue({ | ||
basePath: `http://localhost:${ketoContainer.getMappedPort(KETO_READ_PORT)}`, | ||
}) | ||
.compile() | ||
|
||
Check failure on line 75 in packages/keto/integration/test/client-read.test.ts GitHub Actions / Test:IntegrationKeto read client
Raw output
|
||
app = module.createNestApplication() | ||
Check failure on line 76 in packages/keto/integration/test/client-read.test.ts GitHub Actions / Test:IntegrationKeto read client
Raw output
|
||
|
||
await app.init() | ||
await app.listen(APP_PORT) | ||
|
||
url = await app.getHttpServer() | ||
}) | ||
|
||
afterAll(async () => { | ||
await app.close() | ||
|
||
await dbContainer.stop() | ||
await ketoContainer.stop() | ||
}) | ||
|
||
it('allowed', async () => request(url).get('/allowed').expect(200)) | ||
|
||
it('allows if relation tuple is ok', async () => | ||
request(url).get('/protected-by-keto').set('x-user', 'testUser').expect(200)) | ||
}) |
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,34 @@ | ||
version: v0.11.1-alpha.0 | ||
|
||
dsn: memory | ||
|
||
serve: | ||
read: | ||
host: 0.0.0.0 | ||
cors: | ||
enabled: false | ||
allow_credentials: true | ||
debug: true | ||
write: | ||
host: 0.0.0.0 | ||
cors: | ||
enabled: false | ||
allow_credentials: true | ||
debug: true | ||
|
||
opl: | ||
host: localhost | ||
cors: | ||
enabled: false | ||
allow_credentials: true | ||
debug: true | ||
|
||
namespaces: | ||
location: file:///home/ory/namespaces.keto.ts | ||
|
||
log: | ||
level: debug | ||
format: text | ||
leak_sensitive_values: true | ||
|
||
$schema: file:///config/keto/schema.json |
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,11 @@ | ||
/* eslint-disable */ | ||
|
||
// @ts-ignore | ||
class User implements Namespace {} | ||
|
||
// @ts-ignore | ||
class Group implements Namespace { | ||
related: { | ||
members: User[] | ||
} | ||
} |
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 @@ | ||
{ | ||
"namespace": "Group", | ||
"object": "admin", | ||
"relation": "members", | ||
"subject_id": "testUser" | ||
} |
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,54 @@ | ||
import { FileToCopy } from 'testcontainers/build/types' | ||
|
||
export const KETO_MIGRATE_COMMAND = ['migrate', 'up', '--yes'] | ||
|
||
export const KETO_START_COMMAND = ['serve'] | ||
|
||
export const KETO_INIT_COMMAND = [ | ||
'keto', | ||
'relation-tuple', | ||
'create', | ||
'/home/ory/relationships', | ||
'--insecure-disable-transport-security', | ||
'--insecure-skip-hostname-verification', | ||
] | ||
|
||
export const DB_ENVIRONMENT = { | ||
POSTGRESQL_PASSWORD: 'password', | ||
POSTGRESQL_DATABASE: 'db', | ||
POSTGRESQL_USER: 'postgres', | ||
} | ||
|
||
export const DB_PORT = 5432 | ||
|
||
export const KETO_ENVIRONMENT = { | ||
KETO_WRITE_REMOTE: 'localhost:4467', | ||
KETO_READ_REMOTE: 'localhost:4466', | ||
LOG_LEVEL: 'debug', | ||
DSN: `postgres://${DB_ENVIRONMENT.POSTGRESQL_USER}:${DB_ENVIRONMENT.POSTGRESQL_PASSWORD}@${ | ||
DB_ENVIRONMENT.POSTGRESQL_DATABASE | ||
}:${DB_PORT.toString()}/db?sslmode=disable&max_conns=20&max_idle_conns=4`, | ||
} | ||
|
||
export const KETO_READ_PORT = 4466 | ||
|
||
export const KETO_WRITE_PORT = 4467 | ||
|
||
const PROJECT_PATH = | ||
'/Users/nikoroach/Documents/Typescript/atlantis/nestjs/packages/keto/integration/test' | ||
|
||
export const KETO_FILES: FileToCopy[] = [ | ||
{ | ||
source: `${PROJECT_PATH}/keto.yml`, | ||
target: '/home/ory/keto.yml', | ||
}, | ||
{ | ||
source: `${PROJECT_PATH}/namespaces.keto.ts`, | ||
target: '/home/ory/namespaces.keto.ts', | ||
}, | ||
{ | ||
source: `${PROJECT_PATH}/relationships.json`, | ||
target: '/home/ory/relationships/relationships.json', | ||
}, | ||
] | ||
export const APP_PORT = 3000 |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
import { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants' | ||
import { ReplaceGenerator } from './guarded-by-keto.interfaces' | ||
import { GetGuardingRelationTuple } from './guarded-by-keto.interfaces' | ||
|
||
export const getGuardingRelationTuple: GetGuardingRelationTuple = (reflector, handler) => | ||
reflector.get<string | ReplaceGenerator, typeof GUARDED_BY_METADATA_KEY>( | ||
GUARDED_BY_METADATA_KEY, | ||
handler | ||
) ?? null |
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 @@ | ||
export const GUARDED_BY_METADATA_KEY = Symbol('GuardedByKeto') |
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,7 @@ | ||
import { SetMetadata } from '@nestjs/common' | ||
|
||
import { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants' | ||
import { GuardedByKetoFunction } from './guarded-by-keto.interfaces' | ||
|
||
export const GuardedByKeto: GuardedByKetoFunction = (relationTuple) => | ||
SetMetadata(GUARDED_BY_METADATA_KEY, relationTuple) |
13 changes: 13 additions & 0 deletions
13
packages/keto/src/decorators/guarded-by-keto.interfaces.ts
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,13 @@ | ||
import { CustomDecorator } from '@nestjs/common' | ||
import { Reflector } from '@nestjs/core' | ||
|
||
export type GetGuardingRelationTuple = ( | ||
reflector: Reflector, | ||
handler: Parameters<Reflector['get']>[1] | ||
) => string | ReplaceGenerator | ||
|
||
export type ReplaceGenerator = (value: string) => string | ||
|
||
export type GuardedByKetoFunction = ( | ||
relationTuple: string | ReplaceGenerator | ||
) => CustomDecorator<symbol> |
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 +1,5 @@ | ||
export * from './access-policy.decorator' | ||
export * from './guarded-by-keto.decorator' | ||
export { GuardedByKetoFunction } from './guarded-by-keto.interfaces' | ||
export { GetGuardingRelationTuple } from './guarded-by-keto.interfaces' | ||
export { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants' | ||
export { getGuardingRelationTuple } from './get-guarding-relation.helper' |
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,4 @@ | ||
export enum KetoExceptionMessage { | ||
GENERAL_ERROR = 'General Keto error', | ||
RELATION_TUPLE_INVALID = 'Provided relation tuple is invalid', | ||
} |
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,9 @@ | ||
import { AssertionError } from 'assert' | ||
|
||
import { KetoExceptionMessage } from './exception-message.constants' | ||
|
||
export class KetoGeneralException extends AssertionError { | ||
constructor(message: string) { | ||
super({ message: `${KetoExceptionMessage.GENERAL_ERROR}: ${message}` }) | ||
} | ||
} |
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 @@ | ||
export * from './general.exception' | ||
export * from './relation-tuple-invalid.exception' |
Oops, something went wrong.