@veloxts/auth 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 VeloxTS Framework Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# @veloxts/auth
|
|
2
|
+
|
|
3
|
+
Authentication and authorization system for VeloxTS Framework.
|
|
4
|
+
|
|
5
|
+
> **Note:** This package is a placeholder in v0.1.0. Full implementation coming in v1.1.
|
|
6
|
+
|
|
7
|
+
## Status
|
|
8
|
+
|
|
9
|
+
This package is reserved for future functionality. The current release includes only type definitions and stub implementations to allow other packages to reference it.
|
|
10
|
+
|
|
11
|
+
## Planned Features (v1.1+)
|
|
12
|
+
|
|
13
|
+
- **Session Management** - Secure session handling with configurable stores
|
|
14
|
+
- **JWT Authentication** - Token-based authentication with refresh tokens
|
|
15
|
+
- **Guards and Policies** - Declarative authorization for procedures
|
|
16
|
+
- **Role-Based Access Control** - Define roles and permissions
|
|
17
|
+
- **User Model Integration** - Seamless integration with Prisma user models
|
|
18
|
+
- **OAuth Providers** - Social login support (Google, GitHub, etc.)
|
|
19
|
+
|
|
20
|
+
## Current Exports
|
|
21
|
+
|
|
22
|
+
The following are available but not fully implemented:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { createAuth, guard, User } from '@veloxts/auth';
|
|
26
|
+
|
|
27
|
+
// User interface for type definitions
|
|
28
|
+
interface User {
|
|
29
|
+
id: string;
|
|
30
|
+
email: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Placeholder - returns stub implementation
|
|
35
|
+
const auth = createAuth({ secret: 'your-secret' });
|
|
36
|
+
|
|
37
|
+
// Placeholder decorator
|
|
38
|
+
@guard(['admin'])
|
|
39
|
+
class AdminProcedures { }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Roadmap
|
|
43
|
+
|
|
44
|
+
| Version | Features |
|
|
45
|
+
|---------|----------|
|
|
46
|
+
| v0.1.0 | Placeholder with type definitions |
|
|
47
|
+
| v1.1.0 | JWT authentication, session management |
|
|
48
|
+
| v1.2.0 | Guards, policies, RBAC |
|
|
49
|
+
| v1.3.0 | OAuth providers |
|
|
50
|
+
|
|
51
|
+
## Related Packages
|
|
52
|
+
|
|
53
|
+
- [@veloxts/core](../core) - Application framework
|
|
54
|
+
- [@veloxts/router](../router) - Procedure definitions and routing
|
|
55
|
+
- [@veloxts/orm](../orm) - Database integration
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
[MIT](../../LICENSE)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @veloxts/auth - Authentication and authorization system
|
|
3
|
+
*
|
|
4
|
+
* Provides authentication middleware, session management, and authorization
|
|
5
|
+
* guards for VeloxTS applications. Deferred to v1.1+ release.
|
|
6
|
+
*
|
|
7
|
+
* @note This package is a placeholder for MVP (v0.1.0)
|
|
8
|
+
*/
|
|
9
|
+
export declare const AUTH_VERSION = "0.1.0";
|
|
10
|
+
/**
|
|
11
|
+
* User interface for authenticated requests
|
|
12
|
+
*/
|
|
13
|
+
export interface User {
|
|
14
|
+
id: string;
|
|
15
|
+
email: string;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates an authentication plugin for VeloxTS
|
|
20
|
+
*
|
|
21
|
+
* @param config - Authentication configuration
|
|
22
|
+
* @returns Auth plugin
|
|
23
|
+
*
|
|
24
|
+
* @note Full implementation coming in v1.1+
|
|
25
|
+
*/
|
|
26
|
+
export declare function createAuth(_config?: {
|
|
27
|
+
secret?: string;
|
|
28
|
+
sessionStore?: unknown;
|
|
29
|
+
}): {
|
|
30
|
+
version: string;
|
|
31
|
+
middleware: () => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Authorization guard decorator (placeholder)
|
|
35
|
+
*
|
|
36
|
+
* @note Full implementation coming in v1.1+
|
|
37
|
+
*/
|
|
38
|
+
export declare function guard(permissions: string[]): (target: unknown) => unknown;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO;;;EAOnF;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,IACjC,QAAQ,OAAO,aAIxB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @veloxts/auth - Authentication and authorization system
|
|
3
|
+
*
|
|
4
|
+
* Provides authentication middleware, session management, and authorization
|
|
5
|
+
* guards for VeloxTS applications. Deferred to v1.1+ release.
|
|
6
|
+
*
|
|
7
|
+
* @note This package is a placeholder for MVP (v0.1.0)
|
|
8
|
+
*/
|
|
9
|
+
export const AUTH_VERSION = '0.1.0';
|
|
10
|
+
/**
|
|
11
|
+
* Creates an authentication plugin for VeloxTS
|
|
12
|
+
*
|
|
13
|
+
* @param config - Authentication configuration
|
|
14
|
+
* @returns Auth plugin
|
|
15
|
+
*
|
|
16
|
+
* @note Full implementation coming in v1.1+
|
|
17
|
+
*/
|
|
18
|
+
export function createAuth(_config = {}) {
|
|
19
|
+
return {
|
|
20
|
+
version: AUTH_VERSION,
|
|
21
|
+
middleware: () => {
|
|
22
|
+
console.log('Auth middleware placeholder (v1.1+)');
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Authorization guard decorator (placeholder)
|
|
28
|
+
*
|
|
29
|
+
* @note Full implementation coming in v1.1+
|
|
30
|
+
*/
|
|
31
|
+
export function guard(permissions) {
|
|
32
|
+
return (target) => {
|
|
33
|
+
console.log(`Guard decorator placeholder: ${permissions.join(', ')}`);
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AAWpC;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,UAAuD,EAAE;IAClF,OAAO;QACL,OAAO,EAAE,YAAY;QACrB,UAAU,EAAE,GAAG,EAAE;YACf,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACrD,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,WAAqB;IACzC,OAAO,CAAC,MAAe,EAAE,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,gCAAgC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@veloxts/auth",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Authentication and authorization system for VeloxTS framework (v1.1+)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@veloxts/core": "0.1.0",
|
|
20
|
+
"@veloxts/router": "0.1.0",
|
|
21
|
+
"@veloxts/orm": "0.1.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "5.9.3"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"velox",
|
|
28
|
+
"auth",
|
|
29
|
+
"authentication",
|
|
30
|
+
"authorization",
|
|
31
|
+
"typescript"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/veloxts/velox-ts-framework",
|
|
37
|
+
"directory": "packages/auth"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc",
|
|
47
|
+
"dev": "tsc --watch",
|
|
48
|
+
"type-check": "tsc --noEmit",
|
|
49
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
50
|
+
}
|
|
51
|
+
}
|