auth-strategy-manager 1.0.7
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/README.md +301 -0
- package/README_RU.md +299 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# Auth Strategy Manager
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/auth-strategy-manager)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
|
|
6
|
+
A flexible library for managing authentication with support for multiple strategies. Allows easy integration of various authentication methods (Keycloak, REST API, custom) into a unified interface.
|
|
7
|
+
|
|
8
|
+
## π Documentation in Other Languages
|
|
9
|
+
|
|
10
|
+
- [π·πΊ Π ΡΡΡΠΊΠΈΠΉ (Russian)](README_RU.md)
|
|
11
|
+
- [πΊπΈ English (Current)](README.md)
|
|
12
|
+
|
|
13
|
+
## π¦ Packages
|
|
14
|
+
|
|
15
|
+
This repository contains the following packages:
|
|
16
|
+
|
|
17
|
+
- **[@auth-strategy-manager/core](https://www.npmjs.com/package/@auth-strategy-manager/core)** - Core authentication strategy manager: provides the main classes and interfaces for managing authentication strategies, including `AuthStrategyManager`, `Strategy`, `StrategyHelper`, error classes, and constants.
|
|
18
|
+
- **[@auth-strategy-manager/keycloak](https://www.npmjs.com/package/@auth-strategy-manager/keycloak)** - Keycloak strategy
|
|
19
|
+
- **[@auth-strategy-manager/rest](https://www.npmjs.com/package/@auth-strategy-manager/rest)** - REST API strategy
|
|
20
|
+
|
|
21
|
+
## π Quick Start
|
|
22
|
+
|
|
23
|
+
### Install Core Package
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @auth-strategy-manager/core
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Install with Keycloak Strategy
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/keycloak keycloak-js
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Install with REST Strategy
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/rest axios
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Install All Packages
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/keycloak @auth-strategy-manager/rest keycloak-js axios
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## π§ Usage
|
|
48
|
+
|
|
49
|
+
### Basic Usage with Core Only
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { AuthStrategyManager, Strategy } from '@auth-strategy-manager/core';
|
|
53
|
+
|
|
54
|
+
// Create custom strategy
|
|
55
|
+
class CustomStrategy implements Strategy {
|
|
56
|
+
readonly name = 'custom';
|
|
57
|
+
|
|
58
|
+
public checkAuth = async (): Promise<boolean> => {
|
|
59
|
+
// Your authentication sign-ic
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
public signIn = async <T = unknown, D = undefined>(config?: D): Promise<T> => {
|
|
64
|
+
// Your sign in sign-ic
|
|
65
|
+
return {} as T;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
public signUp = async <T = unknown, D = undefined>(config?: D): Promise<T> => {
|
|
69
|
+
// Your sign up sign-ic
|
|
70
|
+
return {} as T;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
public signOut = async (): Promise<void> => {
|
|
74
|
+
// Your sign out sign-ic
|
|
75
|
+
this.clearStorage();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
public refreshToken = async <T>(args?: T): Promise<void> => {
|
|
79
|
+
// Your token refresh sign-ic
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
public clear = (): void => {
|
|
83
|
+
// Your clear logic
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Use with strategy manager
|
|
88
|
+
const authManager = new AuthStrategyManager([new CustomStrategy()]);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### AuthStrategyManager API
|
|
92
|
+
|
|
93
|
+
Main class for managing authentication strategies.
|
|
94
|
+
|
|
95
|
+
#### Constructor
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
constructor(strategies: Strategy[])
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Creates a new AuthStrategyManager instance with the provided strategies.
|
|
102
|
+
|
|
103
|
+
#### Properties
|
|
104
|
+
|
|
105
|
+
- `strategiesCount: number` - Total number of registered strategies
|
|
106
|
+
- `strategy: Strategy` - Currently active strategy
|
|
107
|
+
- `startUrl: string | undefined` - URL to redirect after authentication
|
|
108
|
+
|
|
109
|
+
#### Methods
|
|
110
|
+
|
|
111
|
+
- `checkAuth(): Promise<boolean>` - Check authentication status across all strategies. Returns true if any strategy is authenticated.
|
|
112
|
+
- `setStrategies(strategies: Strategy[]): Promise<void>` - Replace all strategies with new ones
|
|
113
|
+
- `use(strategyName: string): void` - Set the active strategy by name
|
|
114
|
+
- `clear(): void` - Clear authentication state and reset all strategies
|
|
115
|
+
|
|
116
|
+
#### Usage Examples
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
// Create manager with strategies
|
|
120
|
+
const authManager = new AuthStrategyManager([strategy1, strategy2]);
|
|
121
|
+
|
|
122
|
+
// Check if user is authenticated
|
|
123
|
+
const isAuthenticated = await authManager.checkAuth();
|
|
124
|
+
|
|
125
|
+
// Switch to specific strategy
|
|
126
|
+
authManager.use('keycloak');
|
|
127
|
+
|
|
128
|
+
// Get current active strategy
|
|
129
|
+
const currentStrategy = authManager.strategy;
|
|
130
|
+
|
|
131
|
+
// Clear all authentication data
|
|
132
|
+
authManager.clear();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Using Keycloak Strategy
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
139
|
+
import { KeycloakStrategy } from '@auth-strategy-manager/keycloak';
|
|
140
|
+
|
|
141
|
+
const keycloakStrategy = new KeycloakStrategy({
|
|
142
|
+
keycloak: {
|
|
143
|
+
realm: 'my-realm',
|
|
144
|
+
url: 'https://keycloak.example.com',
|
|
145
|
+
clientId: 'my-client'
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const authManager = new AuthStrategyManager([keycloakStrategy]);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Using REST Strategy
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
156
|
+
import { RestStrategy } from '@auth-strategy-manager/rest';
|
|
157
|
+
|
|
158
|
+
const restStrategy = new RestStrategy({
|
|
159
|
+
checkAuth: { url: '/api/auth/check-auth', method: 'GET' },
|
|
160
|
+
signIn: { url: '/api/auth/sign-in', method: 'POST' },
|
|
161
|
+
signUp: { url: '/api/auth/sign-up', method: 'POST' },
|
|
162
|
+
signOut: { url: '/api/auth/sign-out', method: 'POST' },
|
|
163
|
+
refresh: { url: '/api/auth/refresh', method: 'POST' }
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
const authManager = new AuthStrategyManager([restStrategy]);
|
|
167
|
+
|
|
168
|
+
// Check authentication
|
|
169
|
+
const isAuthenticated = await restStrategy.checkAuth();
|
|
170
|
+
|
|
171
|
+
// Sign out
|
|
172
|
+
await restStrategy.signOut();
|
|
173
|
+
|
|
174
|
+
// Clear state
|
|
175
|
+
restStrategy.clear();
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Using Multiple Strategies
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
182
|
+
import { KeycloakStrategy } from '@auth-strategy-manager/keycloak';
|
|
183
|
+
import { RestStrategy } from '@auth-strategy-manager/rest';
|
|
184
|
+
|
|
185
|
+
const keycloakStrategy = new KeycloakStrategy({
|
|
186
|
+
keycloak: {
|
|
187
|
+
realm: 'my-realm',
|
|
188
|
+
url: 'https://keycloak.example.com',
|
|
189
|
+
clientId: 'my-client'
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const restStrategy = new RestStrategy({
|
|
194
|
+
check: { url: '/api/auth/check-auth', method: 'GET' },
|
|
195
|
+
signIn: { url: '/api/auth/sign-in', method: 'POST' },
|
|
196
|
+
signUp: { url: '/api/auth/sign-up', method: 'POST' },
|
|
197
|
+
signOut: { url: '/api/auth/sign-out', method: 'POST' },
|
|
198
|
+
refresh: { url: '/api/auth/refresh', method: 'POST' }
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const authManager = new AuthStrategyManager([keycloakStrategy, restStrategy]);
|
|
202
|
+
|
|
203
|
+
// Check authentication (will try both strategies)
|
|
204
|
+
const isAuthenticated = await authManager.check();
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## ποΈ Architecture
|
|
208
|
+
|
|
209
|
+
### Core Package (@auth-strategy-manager/core)
|
|
210
|
+
|
|
211
|
+
Contains the main classes and interfaces:
|
|
212
|
+
|
|
213
|
+
- `AuthStrategyManager` - Main manager class
|
|
214
|
+
- `Strategy` - Interface for all strategies
|
|
215
|
+
- `StrategyHelper` - Helper class for state management
|
|
216
|
+
- Error classes and constants
|
|
217
|
+
|
|
218
|
+
### Keycloak Package (@auth-strategy-manager/keycloak)
|
|
219
|
+
|
|
220
|
+
Provides Keycloak integration:
|
|
221
|
+
|
|
222
|
+
- `KeycloakStrategy` - Keycloak authentication strategy
|
|
223
|
+
- Keycloak-specific configuration types
|
|
224
|
+
|
|
225
|
+
### REST Package (@auth-strategy-manager/rest)
|
|
226
|
+
|
|
227
|
+
Provides REST API integration:
|
|
228
|
+
|
|
229
|
+
- `RestStrategy` - REST API authentication strategy
|
|
230
|
+
- REST-specific configuration types
|
|
231
|
+
|
|
232
|
+
## π Documentation
|
|
233
|
+
|
|
234
|
+
- [Core Package Documentation](https://www.npmjs.com/package/@auth-strategy-manager/core)
|
|
235
|
+
- [Keycloak Strategy Documentation](https://www.npmjs.com/package/@auth-strategy-manager/keycloak)
|
|
236
|
+
- [REST Strategy Documentation](https://www.npmjs.com/package/@auth-strategy-manager/rest)
|
|
237
|
+
|
|
238
|
+
## π§ͺ Development
|
|
239
|
+
|
|
240
|
+
### Setup
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Install dependencies
|
|
244
|
+
npm install
|
|
245
|
+
|
|
246
|
+
# Build all packages
|
|
247
|
+
npm run build
|
|
248
|
+
|
|
249
|
+
# Build specific package
|
|
250
|
+
npm run build --workspace=@auth-strategy-manager/core
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Publishing
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# Publish all packages
|
|
257
|
+
npm run publish:all
|
|
258
|
+
|
|
259
|
+
# Publish specific package
|
|
260
|
+
npm run publish:core
|
|
261
|
+
npm run publish:keycloak
|
|
262
|
+
npm run publish:rest
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## π License
|
|
266
|
+
|
|
267
|
+
ISC License
|
|
268
|
+
|
|
269
|
+
## π€ Contributing
|
|
270
|
+
|
|
271
|
+
1. Fork the repository
|
|
272
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
273
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
274
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
275
|
+
5. Open a Pull Request
|
|
276
|
+
|
|
277
|
+
## π Support
|
|
278
|
+
|
|
279
|
+
If you have questions or issues, create an issue in the GitHub repository.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
**Auth Strategy Manager** - make authentication simple and flexible! π
|
|
284
|
+
|
|
285
|
+
### Strategy Interface
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
interface Strategy {
|
|
289
|
+
name: string;
|
|
290
|
+
token?: string;
|
|
291
|
+
isAuthenticated?: boolean;
|
|
292
|
+
startUrl?: string;
|
|
293
|
+
signInUrl?: string;
|
|
294
|
+
|
|
295
|
+
checkAuth(): Promise<boolean>;
|
|
296
|
+
signIn<T = unknown, D = undefined>(config?: D): Promise<T>;
|
|
297
|
+
signUp<T = unknown, D = undefined>(config?: D): Promise<T>;
|
|
298
|
+
signOut(): Promise<void>;
|
|
299
|
+
refreshToken<T>(args?: T): Promise<void>;
|
|
300
|
+
}
|
|
301
|
+
```
|
package/README_RU.md
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# Auth Strategy Manager
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/auth-strategy-manager)
|
|
4
|
+
[](https://opensource.org/licenses/ISC)
|
|
5
|
+
|
|
6
|
+
ΠΠΈΠ±ΠΊΠ°Ρ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠ° Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠ΅ΠΉ Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΎΠΉ ΠΌΠ½ΠΎΠΆΠ΅ΡΡΠ²Π΅Π½Π½ΡΡ
ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ. ΠΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ Π»Π΅Π³ΠΊΠΎ ΠΈΠ½ΡΠ΅Π³ΡΠΈΡΠΎΠ²Π°ΡΡ ΡΠ°Π·Π»ΠΈΡΠ½ΡΠ΅ ΠΌΠ΅ΡΠΎΠ΄Ρ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ (Keycloak, REST API, ΠΊΠ°ΡΡΠΎΠΌΠ½ΡΠ΅) Π² Π΅Π΄ΠΈΠ½ΡΠΉ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡ.
|
|
7
|
+
|
|
8
|
+
## π ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ Π½Π° Π΄ΡΡΠ³ΠΈΡ
ΡΠ·ΡΠΊΠ°Ρ
|
|
9
|
+
|
|
10
|
+
- [πΊπΈ English (ΠΠ½Π³Π»ΠΈΠΉΡΠΊΠΈΠΉ)](README.md)
|
|
11
|
+
- [π·πΊ Π ΡΡΡΠΊΠΈΠΉ (Π’Π΅ΠΊΡΡΠΈΠΉ)](README_RU.md)
|
|
12
|
+
|
|
13
|
+
## π¦ ΠΠ°ΠΊΠ΅ΡΡ
|
|
14
|
+
|
|
15
|
+
ΠΡΠΎΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ ΡΠ»Π΅Π΄ΡΡΡΠΈΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ:
|
|
16
|
+
|
|
17
|
+
- **[@auth-strategy-manager/core](https://www.npmjs.com/package/@auth-strategy-manager/core)** β ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ: ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ Π³Π»Π°Π²Π½ΡΠ΅ ΠΊΠ»Π°ΡΡΡ ΠΈ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΡ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡΠΌΠΈ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ, Π²ΠΊΠ»ΡΡΠ°Ρ `AuthStrategyManager`, `Strategy`, `StrategyHelper`, ΠΊΠ»Π°ΡΡΡ ΠΎΡΠΈΠ±ΠΎΠΊ ΠΈ ΠΊΠΎΠ½ΡΡΠ°Π½ΡΡ.
|
|
18
|
+
- **[@auth-strategy-manager/keycloak](https://www.npmjs.com/package/@auth-strategy-manager/keycloak)** β ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ Keycloak
|
|
19
|
+
- **[@auth-strategy-manager/rest](https://www.npmjs.com/package/@auth-strategy-manager/rest)** β ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ REST API
|
|
20
|
+
|
|
21
|
+
## π ΠΡΡΡΡΡΠΉ ΡΡΠ°ΡΡ
|
|
22
|
+
|
|
23
|
+
### Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @auth-strategy-manager/core
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Ρ Keycloak ΡΡΡΠ°ΡΠ΅Π³ΠΈΠ΅ΠΉ
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/keycloak keycloak-js
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Ρ REST ΡΡΡΠ°ΡΠ΅Π³ΠΈΠ΅ΠΉ
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/rest axios
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π²ΡΠ΅Ρ
ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @auth-strategy-manager/core @auth-strategy-manager/keycloak @auth-strategy-manager/rest keycloak-js axios
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## π§ ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅
|
|
48
|
+
|
|
49
|
+
### ΠΠ°Π·ΠΎΠ²ΠΎΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΎΠ»ΡΠΊΠΎ Ρ core
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { AuthStrategyManager, Strategy } from '@auth-strategy-manager/core';
|
|
53
|
+
|
|
54
|
+
// Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΡΠΎΠΌΠ½ΠΎΠΉ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ
|
|
55
|
+
class CustomStrategy implements Strategy {
|
|
56
|
+
readonly name = 'custom';
|
|
57
|
+
|
|
58
|
+
public checkAuth = async (): Promise<boolean> => {
|
|
59
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
public signIn = async <T = unknown, D = undefined>(config?: D): Promise<T> => {
|
|
64
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° Π²Ρ
ΠΎΠ΄Π°
|
|
65
|
+
return {} as T;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
public signUp = async <T = unknown, D = undefined>(config?: D): Promise<T> => {
|
|
69
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° ΡΠ΅Π³ΠΈΡΡΡΠ°ΡΠΈΠΈ
|
|
70
|
+
return {} as T;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
public signOut = async (): Promise<void> => {
|
|
74
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° Π²ΡΡ
ΠΎΠ΄Π°
|
|
75
|
+
this.clearStorage();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
public refreshToken = async <T>(args?: T): Promise<void> => {
|
|
79
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ ΡΠΎΠΊΠ΅Π½Π°
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
public clear = (): void => {
|
|
83
|
+
// ΠΠ°ΡΠ° Π»ΠΎΠ³ΠΈΠΊΠ° ΠΎΡΠΈΡΡΠΊΠΈ
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Ρ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠΎΠΌ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ
|
|
88
|
+
const authManager = new AuthStrategyManager([new CustomStrategy()]);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### AuthStrategyManager API
|
|
92
|
+
|
|
93
|
+
ΠΠ»Π°Π²Π½ΡΠΉ ΠΊΠ»Π°ΡΡ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡΠΌΠΈ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ.
|
|
94
|
+
|
|
95
|
+
#### ΠΠΎΠ½ΡΡΡΡΠΊΡΠΎΡ
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
constructor(strategies: Strategy[])
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Π‘ΠΎΠ·Π΄Π°Π΅Ρ Π½ΠΎΠ²ΡΠΉ ΡΠΊΠ·Π΅ΠΌΠΏΠ»ΡΡ AuthStrategyManager Ρ ΠΏΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»Π΅Π½Π½ΡΠΌΠΈ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡΠΌΠΈ.
|
|
102
|
+
|
|
103
|
+
#### Π‘Π²ΠΎΠΉΡΡΠ²Π°
|
|
104
|
+
|
|
105
|
+
- `strategiesCount: number` - ΠΠ±ΡΠ΅Π΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ Π·Π°ΡΠ΅Π³ΠΈΡΡΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ
ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ
|
|
106
|
+
- `strategy: Strategy` - Π’Π΅ΠΊΡΡΠ°Ρ Π°ΠΊΡΠΈΠ²Π½Π°Ρ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ
|
|
107
|
+
- `startUrl: string | undefined` - URL Π΄Π»Ρ ΠΏΠ΅ΡΠ΅Π½Π°ΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΠΏΠΎΡΠ»Π΅ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ
|
|
108
|
+
|
|
109
|
+
#### ΠΠ΅ΡΠΎΠ΄Ρ
|
|
110
|
+
|
|
111
|
+
- `checkAuth(): Promise<boolean>` - ΠΡΠΎΠ²Π΅ΡΡΠ΅Ρ ΡΡΠ°ΡΡΡ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ ΠΏΠΎ Π²ΡΠ΅ΠΌ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡΠΌ. ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ true, Π΅ΡΠ»ΠΈ Π»ΡΠ±Π°Ρ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΡΠΈΡΠΎΠ²Π°Π½Π°.
|
|
112
|
+
- `setStrategies(strategies: Strategy[]): Promise<void>` - ΠΠ°ΠΌΠ΅Π½ΡΠ΅Ρ Π²ΡΠ΅ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ Π½ΠΎΠ²ΡΠΌΠΈ
|
|
113
|
+
- `use(strategyName: string): void` - Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅Ρ Π°ΠΊΡΠΈΠ²Π½ΡΡ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ ΠΏΠΎ ΠΈΠΌΠ΅Π½ΠΈ
|
|
114
|
+
- `clear(): void` - ΠΡΠΈΡΠ°Π΅Ρ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ ΠΈ ΡΠ±ΡΠ°ΡΡΠ²Π°Π΅Ρ Π²ΡΠ΅ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ
|
|
115
|
+
|
|
116
|
+
#### ΠΡΠΈΠΌΠ΅ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
// Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΡΠΎ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡΠΌΠΈ
|
|
120
|
+
const authManager = new AuthStrategyManager([strategy1, strategy2]);
|
|
121
|
+
|
|
122
|
+
// ΠΡΠΎΠ²Π΅ΡΠΊΠ° Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ
|
|
123
|
+
const isAuthenticated = await authManager.checkAuth();
|
|
124
|
+
|
|
125
|
+
// ΠΠ΅ΡΠ΅ΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅ Π½Π° ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΡΡ ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ
|
|
126
|
+
authManager.use('keycloak');
|
|
127
|
+
|
|
128
|
+
// ΠΠΎΠ»ΡΡΠ΅Π½ΠΈΠ΅ ΡΠ΅ΠΊΡΡΠ΅ΠΉ Π°ΠΊΡΠΈΠ²Π½ΠΎΠΉ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ
|
|
129
|
+
const currentStrategy = authManager.strategy;
|
|
130
|
+
|
|
131
|
+
// ΠΡΠΈΡΡΠΊΠ° Π²ΡΠ΅Ρ
Π΄Π°Π½Π½ΡΡ
Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ
|
|
132
|
+
authManager.clear();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Strategy Interface
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
interface Strategy {
|
|
139
|
+
name: string;
|
|
140
|
+
token?: string;
|
|
141
|
+
isAuthenticated?: boolean;
|
|
142
|
+
startUrl?: string;
|
|
143
|
+
signInUrl?: string;
|
|
144
|
+
|
|
145
|
+
checkAuth(): Promise<boolean>;
|
|
146
|
+
signIn<T = unknown, D = undefined>(config?: D): Promise<T>;
|
|
147
|
+
signUp<T = unknown, D = undefined>(config?: D): Promise<T>;
|
|
148
|
+
signOut(): Promise<void>;
|
|
149
|
+
refreshToken<T>(args?: T): Promise<void>;
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Keycloak ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
157
|
+
import { KeycloakStrategy } from '@auth-strategy-manager/keycloak';
|
|
158
|
+
|
|
159
|
+
const keycloakStrategy = new KeycloakStrategy({
|
|
160
|
+
keycloak: {
|
|
161
|
+
realm: 'my-realm',
|
|
162
|
+
url: 'https://keycloak.example.com',
|
|
163
|
+
clientId: 'my-client'
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const authManager = new AuthStrategyManager([keycloakStrategy]);
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ REST ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
174
|
+
import { RestStrategy } from '@auth-strategy-manager/rest';
|
|
175
|
+
|
|
176
|
+
const restStrategy = new RestStrategy({
|
|
177
|
+
checkAuth: { url: '/api/auth/checkAuth', method: 'GET' },
|
|
178
|
+
signIn: { url: '/api/auth/sign-in', method: 'POST' },
|
|
179
|
+
signOut: { url: '/api/auth/sign-out', method: 'POST' },
|
|
180
|
+
refresh: { url: '/api/auth/refresh', method: 'POST' }
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const authManager = new AuthStrategyManager([restStrategy]);
|
|
184
|
+
|
|
185
|
+
// ΠΡΠΎΠ²Π΅ΡΠΊΠ° Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ
|
|
186
|
+
const isAuthenticated = await restStrategy.checkAuth();
|
|
187
|
+
|
|
188
|
+
// ΠΡΡ
ΠΎΠ΄ ΠΈΠ· ΡΠΈΡΡΠ΅ΠΌΡ
|
|
189
|
+
await restStrategy.signOut();
|
|
190
|
+
|
|
191
|
+
// ΠΡΠΈΡΡΠΊΠ° ΡΠΎΡΡΠΎΡΠ½ΠΈΡ
|
|
192
|
+
restStrategy.clear();
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΌΠ½ΠΎΠΆΠ΅ΡΡΠ²Π΅Π½Π½ΡΡ
ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
import { AuthStrategyManager } from '@auth-strategy-manager/core';
|
|
199
|
+
import { KeycloakStrategy } from '@auth-strategy-manager/keycloak';
|
|
200
|
+
import { RestStrategy } from '@auth-strategy-manager/rest';
|
|
201
|
+
|
|
202
|
+
const keycloakStrategy = new KeycloakStrategy({
|
|
203
|
+
keycloak: {
|
|
204
|
+
realm: 'my-realm',
|
|
205
|
+
url: 'https://keycloak.example.com',
|
|
206
|
+
clientId: 'my-client'
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const restStrategy = new RestStrategy({
|
|
211
|
+
checkAuth: { url: '/api/auth/check-auth', method: 'GET' },
|
|
212
|
+
signIn: { url: '/api/auth/sign-in', method: 'POST' },
|
|
213
|
+
signOut: { url: '/api/auth/sign-out', method: 'POST' },
|
|
214
|
+
refresh: { url: '/api/auth/refresh', method: 'POST' }
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
const authManager = new AuthStrategyManager([keycloakStrategy, restStrategy]);
|
|
218
|
+
|
|
219
|
+
// ΠΡΠΎΠ²Π΅ΡΠΊΠ° Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ (ΠΏΠΎΠΏΡΠΎΠ±ΡΠ΅Ρ ΠΎΠ±Π΅ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ)
|
|
220
|
+
const isAuthenticated = await authManager.checkAuth();
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## ποΈ ΠΡΡ
ΠΈΡΠ΅ΠΊΡΡΡΠ°
|
|
224
|
+
|
|
225
|
+
### ΠΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΠΏΠ°ΠΊΠ΅Ρ (@auth-strategy-manager/core)
|
|
226
|
+
|
|
227
|
+
Π‘ΠΎΠ΄Π΅ΡΠΆΠΈΡ ΠΎΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΊΠ»Π°ΡΡΡ ΠΈ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΡ:
|
|
228
|
+
|
|
229
|
+
- `AuthStrategyManager` β Π³Π»Π°Π²Π½ΡΠΉ ΠΊΠ»Π°ΡΡ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ°
|
|
230
|
+
- `Strategy` β ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡ Π΄Π»Ρ Π²ΡΠ΅Ρ
ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΉ
|
|
231
|
+
- `StrategyHelper` β Π²ΡΠΏΠΎΠΌΠΎΠ³Π°ΡΠ΅Π»ΡΠ½ΡΠΉ ΠΊΠ»Π°ΡΡ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ΠΌ
|
|
232
|
+
- ΠΠ»Π°ΡΡΡ ΠΎΡΠΈΠ±ΠΎΠΊ ΠΈ ΠΊΠΎΠ½ΡΡΠ°Π½ΡΡ
|
|
233
|
+
|
|
234
|
+
### ΠΠ°ΠΊΠ΅Ρ Keycloak (@auth-strategy-manager/keycloak)
|
|
235
|
+
|
|
236
|
+
ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΡ Ρ Keycloak:
|
|
237
|
+
|
|
238
|
+
- `KeycloakStrategy` β ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ Keycloak
|
|
239
|
+
- Π’ΠΈΠΏΡ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ Π΄Π»Ρ Keycloak
|
|
240
|
+
|
|
241
|
+
### ΠΠ°ΠΊΠ΅Ρ REST (@auth-strategy-manager/rest)
|
|
242
|
+
|
|
243
|
+
ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ ΠΈΠ½ΡΠ΅Π³ΡΠ°ΡΠΈΡ Ρ REST API:
|
|
244
|
+
|
|
245
|
+
- `RestStrategy` β ΡΡΡΠ°ΡΠ΅Π³ΠΈΡ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ REST API
|
|
246
|
+
- Π’ΠΈΠΏΡ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ Π΄Π»Ρ REST
|
|
247
|
+
|
|
248
|
+
## π ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ
|
|
249
|
+
|
|
250
|
+
- [ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ ΠΎΡΠ½ΠΎΠ²Π½ΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°](https://www.npmjs.com/package/@auth-strategy-manager/core)
|
|
251
|
+
- [ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ Keycloak ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ](https://www.npmjs.com/package/@auth-strategy-manager/keycloak)
|
|
252
|
+
- [ΠΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΡ REST ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ](https://www.npmjs.com/package/@auth-strategy-manager/rest)
|
|
253
|
+
|
|
254
|
+
## π§ͺ Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ°
|
|
255
|
+
|
|
256
|
+
### ΠΠ°ΡΡΡΠΎΠΉΠΊΠ°
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ
|
|
260
|
+
npm install
|
|
261
|
+
|
|
262
|
+
# Π‘Π±ΠΎΡΠΊΠ° Π²ΡΠ΅Ρ
ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
|
|
263
|
+
npm run build
|
|
264
|
+
|
|
265
|
+
# Π‘Π±ΠΎΡΠΊΠ° ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°
|
|
266
|
+
npm run build --workspace=@auth-strategy-manager/core
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ Π²ΡΠ΅Ρ
ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
|
|
273
|
+
npm run publish:all
|
|
274
|
+
|
|
275
|
+
# ΠΡΠ±Π»ΠΈΠΊΠ°ΡΠΈΡ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°
|
|
276
|
+
npm run publish:core
|
|
277
|
+
npm run publish:keycloak
|
|
278
|
+
npm run publish:rest
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## π ΠΠΈΡΠ΅Π½Π·ΠΈΡ
|
|
282
|
+
|
|
283
|
+
ISC License
|
|
284
|
+
|
|
285
|
+
## π€ ΠΠΊΠ»Π°Π΄ Π² ΠΏΡΠΎΠ΅ΠΊΡ
|
|
286
|
+
|
|
287
|
+
1. Π€ΠΎΡΠΊΠ½ΠΈΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ
|
|
288
|
+
2. Π‘ΠΎΠ·Π΄Π°ΠΉΡΠ΅ Π²Π΅ΡΠΊΡ Π΄Π»Ρ Π½ΠΎΠ²ΠΎΠΉ ΡΡΠ½ΠΊΡΠΈΠΈ (`git checkAuthout -b feature/amazing-feature`)
|
|
289
|
+
3. ΠΠ°ΡΠΈΠΊΡΠΈΡΡΠΉΡΠ΅ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ (`git commit -m 'Add amazing feature'`)
|
|
290
|
+
4. ΠΡΠΏΡΠ°Π²ΡΡΠ΅ Π² Π²Π΅ΡΠΊΡ (`git push origin feature/amazing-feature`)
|
|
291
|
+
5. ΠΡΠΊΡΠΎΠΉΡΠ΅ Pull Request
|
|
292
|
+
|
|
293
|
+
## π ΠΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ°
|
|
294
|
+
|
|
295
|
+
ΠΡΠ»ΠΈ Ρ Π²Π°Ρ Π΅ΡΡΡ Π²ΠΎΠΏΡΠΎΡΡ ΠΈΠ»ΠΈ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ, ΡΠΎΠ·Π΄Π°ΠΉΡΠ΅ issue Π² GitHub ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**Auth Strategy Manager** - ΡΠ΄Π΅Π»Π°ΠΉΡΠ΅ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΡ ΠΏΡΠΎΡΡΠΎΠΉ ΠΈ Π³ΠΈΠ±ΠΊΠΎΠΉ! π
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@auth-strategy-manager/core';
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@auth-strategy-manager/core');
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "auth-strategy-manager",
|
|
3
|
+
"version": "1.0.7",
|
|
4
|
+
"description": "Meta package for auth-strategy-manager. Installs core by default.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"authentication",
|
|
9
|
+
"authorization",
|
|
10
|
+
"strategy",
|
|
11
|
+
"auth",
|
|
12
|
+
"core"
|
|
13
|
+
],
|
|
14
|
+
"author": "azarov-serge <s.a.azarov@gmail.com>",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/azarov-serge/auth-strategy-manager.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/azarov-serge/auth-strategy-manager/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/azarov-serge/auth-strategy-manager#readme",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@auth-strategy-manager/core": "^1.0.5"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"prepublishOnly": "cp ../README.md ./README.md && cp ../README_RU.md ./README_RU.md"
|
|
29
|
+
}
|
|
30
|
+
}
|