@tinyrack/tinyauth-server 0.0.16 → 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.
Files changed (89) hide show
  1. package/dist/entrypoints/app.d.ts +8 -1
  2. package/dist/entrypoints/app.d.ts.map +1 -1
  3. package/dist/entrypoints/app.js +5 -0
  4. package/dist/entrypoints/app.js.map +1 -1
  5. package/dist/lib/config/client.d.ts.map +1 -1
  6. package/dist/lib/config/client.js +5 -1
  7. package/dist/lib/config/client.js.map +1 -1
  8. package/dist/lib/config/identity-providers.d.ts.map +1 -1
  9. package/dist/lib/config/identity-providers.js +10 -33
  10. package/dist/lib/config/identity-providers.js.map +1 -1
  11. package/dist/lib/config/url-policy.d.ts +4 -0
  12. package/dist/lib/config/url-policy.d.ts.map +1 -0
  13. package/dist/lib/config/url-policy.js +38 -0
  14. package/dist/lib/config/url-policy.js.map +1 -0
  15. package/dist/lib/pkce.d.ts.map +1 -1
  16. package/dist/lib/pkce.js +3 -0
  17. package/dist/lib/pkce.js.map +1 -1
  18. package/dist/middleware/csrf.d.ts +2 -0
  19. package/dist/middleware/csrf.d.ts.map +1 -0
  20. package/dist/middleware/csrf.js +51 -0
  21. package/dist/middleware/csrf.js.map +1 -0
  22. package/dist/repositories/revoked-token.repository.d.ts +20 -0
  23. package/dist/repositories/revoked-token.repository.d.ts.map +1 -1
  24. package/dist/repositories/revoked-token.repository.js +44 -1
  25. package/dist/repositories/revoked-token.repository.js.map +1 -1
  26. package/dist/routes/api/oauth/_provider/authorize/get.d.ts.map +1 -1
  27. package/dist/routes/api/oauth/_provider/authorize/get.js +13 -1
  28. package/dist/routes/api/oauth/_provider/authorize/get.js.map +1 -1
  29. package/dist/routes/api/oauth/_provider/callback/post.d.ts.map +1 -1
  30. package/dist/routes/api/oauth/_provider/callback/post.js +30 -1
  31. package/dist/routes/api/oauth/_provider/callback/post.js.map +1 -1
  32. package/dist/routes/index.d.ts +8 -1
  33. package/dist/routes/index.d.ts.map +1 -1
  34. package/dist/routes/oauth/.well-known/openid-configuration/get.d.ts +4 -0
  35. package/dist/routes/oauth/.well-known/openid-configuration/get.d.ts.map +1 -1
  36. package/dist/routes/oauth/.well-known/openid-configuration/get.js +25 -2
  37. package/dist/routes/oauth/.well-known/openid-configuration/get.js.map +1 -1
  38. package/dist/routes/oauth/authorize/get.d.ts +2 -0
  39. package/dist/routes/oauth/authorize/get.d.ts.map +1 -1
  40. package/dist/routes/oauth/authorize/get.js +4 -0
  41. package/dist/routes/oauth/authorize/get.js.map +1 -1
  42. package/dist/routes/oauth/index.d.ts +8 -1
  43. package/dist/routes/oauth/index.d.ts.map +1 -1
  44. package/dist/routes/oauth/introspect/post.d.ts +1 -0
  45. package/dist/routes/oauth/introspect/post.d.ts.map +1 -1
  46. package/dist/routes/oauth/token/post.d.ts +1 -1
  47. package/dist/routes/oauth/token/post.d.ts.map +1 -1
  48. package/dist/routes/oauth/token/post.js +1 -0
  49. package/dist/routes/oauth/token/post.js.map +1 -1
  50. package/dist/routes/oauth/userinfo/get.d.ts.map +1 -1
  51. package/dist/routes/oauth/userinfo/get.js +3 -0
  52. package/dist/routes/oauth/userinfo/get.js.map +1 -1
  53. package/dist/schemas/error.d.ts +75 -0
  54. package/dist/schemas/error.d.ts.map +1 -1
  55. package/dist/schemas/error.js +3 -0
  56. package/dist/schemas/error.js.map +1 -1
  57. package/dist/schemas/field.d.ts +1 -6
  58. package/dist/schemas/field.d.ts.map +1 -1
  59. package/dist/schemas/field.js +2 -3
  60. package/dist/schemas/field.js.map +1 -1
  61. package/dist/schemas/oauth.d.ts +1 -1
  62. package/dist/schemas/oauth.js +1 -1
  63. package/dist/schemas/oauth.js.map +1 -1
  64. package/dist/schemas/response.d.ts +1 -1
  65. package/dist/services/jwt.service.d.ts +5 -0
  66. package/dist/services/jwt.service.d.ts.map +1 -1
  67. package/dist/services/jwt.service.js +31 -16
  68. package/dist/services/jwt.service.js.map +1 -1
  69. package/dist/services/oauth-authorize.service.d.ts +5 -1
  70. package/dist/services/oauth-authorize.service.d.ts.map +1 -1
  71. package/dist/services/oauth-authorize.service.js +65 -16
  72. package/dist/services/oauth-authorize.service.js.map +1 -1
  73. package/dist/services/oauth-client.service.d.ts +1 -0
  74. package/dist/services/oauth-client.service.d.ts.map +1 -1
  75. package/dist/services/oauth-client.service.js +5 -0
  76. package/dist/services/oauth-client.service.js.map +1 -1
  77. package/dist/services/oauth-connect.service.d.ts +1 -0
  78. package/dist/services/oauth-connect.service.d.ts.map +1 -1
  79. package/dist/services/oauth-connect.service.js +61 -7
  80. package/dist/services/oauth-connect.service.js.map +1 -1
  81. package/dist/services/oauth-token.service.d.ts +8 -1
  82. package/dist/services/oauth-token.service.d.ts.map +1 -1
  83. package/dist/services/oauth-token.service.js +111 -30
  84. package/dist/services/oauth-token.service.js.map +1 -1
  85. package/package.json +1 -1
  86. package/public/assets/{index-CLq6d6iO.js → index-DaJe6s9D.js} +12 -12
  87. package/public/assets/{index-CLq6d6iO.js.map → index-DaJe6s9D.js.map} +1 -1
  88. package/public/index.html +1 -1
  89. package/readme.md +74 -25
package/public/index.html CHANGED
@@ -18,7 +18,7 @@
18
18
  <!-- Preload critical API data for faster initial render -->
19
19
  <link rel="preload" href="/api/config" as="fetch" crossorigin="anonymous" />
20
20
  <link rel="preload" href="/api/user/session" as="fetch" crossorigin="anonymous" />
21
- <script type="module" crossorigin src="/assets/index-CLq6d6iO.js"></script>
21
+ <script type="module" crossorigin src="/assets/index-DaJe6s9D.js"></script>
22
22
  <link rel="stylesheet" crossorigin href="/assets/index-6odabbrQ.css">
23
23
  </head>
24
24
  <body>
package/readme.md CHANGED
@@ -1,41 +1,80 @@
1
- # tinyauth
1
+ <div align="center">
2
2
 
3
- A lightweight, self-hosted OpenID Connect (OIDC) Provider.
3
+ # TinyAuth
4
+
5
+ **A lightweight, self-hosted OpenID Connect provider for modern applications.**
6
+
7
+ [![CI](https://github.com/tinyrack-net/tinyauth/actions/workflows/ci.yml/badge.svg)](https://github.com/tinyrack-net/tinyauth/actions/workflows/ci.yml)
8
+ [![npm server](https://img.shields.io/npm/v/@tinyrack/tinyauth-server?label=server)](https://www.npmjs.com/package/@tinyrack/tinyauth-server)
9
+ [![npm standalone](https://img.shields.io/npm/v/@tinyrack/tinyauth-standalone?label=standalone)](https://www.npmjs.com/package/@tinyrack/tinyauth-standalone)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D24-brightgreen)](https://nodejs.org/)
12
+
13
+ [Documentation](https://tinyauth.tinyrack.net/en/) · [Configuration](https://tinyauth.tinyrack.net/en/configuration/overview/) · [한국어](https://tinyauth.tinyrack.net/ko/)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ TinyAuth is a self-hosted OpenID Connect (OIDC) provider that gives your apps a standards-based login system without bringing in a full identity platform.
20
+
21
+ It supports OAuth2/OIDC authorization code flows, PKCE, password login, passkeys, TOTP, social login, and a customizable multilingual frontend. Run it as a standalone server, ship it with Docker, or embed the server package in your own Node.js application.
4
22
 
5
23
  ## Features
6
24
 
7
- - **OIDC/OAuth2 Compliant** - Authorization Code Flow with PKCE support
8
- - **Multiple Auth Methods** - Password, Passkey/WebAuthn, Social Login (GitHub, Google, Apple, Generic OAuth)
9
- - **Two-Factor Authentication** - TOTP and Passkey as 2FA
10
- - **Multi-language** - English, Korean, Japanese
11
- - **Customizable UI** - Themes, branding, background images, terms of service
12
- - **Database Support** - PostgreSQL, SQLite
13
- - **Docker Ready** - Production-ready container with health checks
25
+ - **OIDC/OAuth2 provider** with authorization code flow, PKCE, discovery, token, userinfo, introspection, and revocation endpoints
26
+ - **Multiple sign-in methods** including password, passkeys/WebAuthn, GitHub, Google, Apple, and generic OAuth/OIDC providers
27
+ - **Two-factor authentication** with TOTP and passkey-based second factors
28
+ - **Config-driven deployment** through a single YAML file
29
+ - **Customizable frontend** with themes, branding, background images, language selection, and terms flows
30
+ - **Database support** for SQLite and PostgreSQL
31
+ - **Standalone or embedded usage** through Docker, the standalone CLI, or `@tinyrack/tinyauth-server`
14
32
 
15
- ## Quick Start
33
+ ## Installation
34
+
35
+ ### Docker
36
+
37
+ ```bash
38
+ docker run --rm \
39
+ -p 8080:8080 \
40
+ -v ./config.yaml:/opt/config.yaml \
41
+ ghcr.io/tinyrack-net/tinyauth:latest
42
+ ```
43
+
44
+ ### Standalone CLI
16
45
 
17
46
  ```bash
18
- docker run -p 8080:8080 -v ./config.yaml:/opt/config.yaml ghcr.io/tinyrack-net/tinyauth
47
+ npm install -g @tinyrack/tinyauth-standalone
19
48
  ```
20
49
 
21
- Visit `http://localhost:8080/.well-known/openid-configuration` to verify the server is running.
50
+ ```bash
51
+ tinyauth serve --config-path ./config.yaml
52
+ ```
22
53
 
23
- ## Configuration
54
+ ### Server package
24
55
 
25
- All configuration is done via `config.yaml`:
56
+ Use the server package when you want to embed TinyAuth in your own Node.js runtime.
57
+
58
+ ```bash
59
+ npm install @tinyrack/tinyauth-server
60
+ ```
61
+
62
+ ## Quick Start
63
+
64
+ Create a minimal `config.yaml`:
26
65
 
27
66
  ```yaml
28
67
  app:
29
- host: https://auth.example.com
68
+ host: http://localhost:8080
30
69
  port: 8080
31
70
 
32
71
  security:
33
- session_secret: <your-session-secret>
34
- hash_secret: <your-hash-secret>
72
+ session_secret: change-me-session-secret
73
+ hash_secret: change-me-hash-secret
35
74
 
36
75
  database:
37
76
  type: sqlite
38
- path: data.db
77
+ path: ./data.db
39
78
 
40
79
  basic_authentication_methods:
41
80
  password:
@@ -44,20 +83,30 @@ basic_authentication_methods:
44
83
  enabled: true
45
84
  ```
46
85
 
47
- See [documentation](https://tinyauth.tinyrack.net) for full configuration options.
86
+ Start TinyAuth:
87
+
88
+ ```bash
89
+ docker run --rm \
90
+ -p 8080:8080 \
91
+ -v ./config.yaml:/opt/config.yaml \
92
+ ghcr.io/tinyrack-net/tinyauth:latest
93
+ ```
48
94
 
49
- ## Development
95
+ Verify the OIDC discovery endpoint:
50
96
 
51
97
  ```bash
52
- pnpm install
53
- pnpm dev
98
+ curl http://localhost:8080/.well-known/openid-configuration
54
99
  ```
55
100
 
56
101
  ## Examples
57
102
 
58
- - `examples/clients/nextjs-ssr` - Next.js OIDC client
59
- - `examples/clients/react-spa` - React SPA PKCE client
60
- - `examples/servers/node-hono-sqlite` - Node.js library-mode deployment of `@tinyrack/tinyauth-server` with Hono, SQLite, and the bundled TinyAuth frontend
103
+ - `examples/clients/nextjs-ssr` Next.js OIDC client with server-side token handling
104
+ - `examples/clients/react-spa` React SPA using authorization code flow with PKCE
105
+ - `examples/servers/node-hono-sqlite` Hono + SQLite deployment using `@tinyrack/tinyauth-server` and the bundled frontend
106
+
107
+ ## Documentation
108
+
109
+ For configuration guides, client integration examples, deployment notes, and the API reference, visit the **[TinyAuth documentation site](https://tinyauth.tinyrack.net/en/)**.
61
110
 
62
111
  ## License
63
112