@hemia/auth-sdk 0.0.2 → 0.0.3
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/dist/hemia-auth-sdk.esm.js +6223 -183
- package/dist/hemia-auth-sdk.js +6225 -185
- package/dist/types/adapters/index.d.ts +1 -0
- package/dist/types/adapters/internal.adapter.d.ts +13 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/controllers/abstract-auth.controller.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ioc.d.ts +5 -4
- package/dist/types/services/auth.service.d.ts +8 -7
- package/dist/types/services/index.d.ts +0 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/session-storage.interface.d.ts +5 -0
- package/package.json +1 -1
- package/dist/types/services/cache.service.d.ts +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./internal.adapter";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ISessionStorage } from "../types";
|
|
2
|
+
export interface IHemiaCacheService {
|
|
3
|
+
setObject<T>(key: string, value: T, expireTime?: number): Promise<void>;
|
|
4
|
+
getObject<T>(key: string): Promise<T | null>;
|
|
5
|
+
deleteKey(key: string): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare class AuthCacheAdapter implements ISessionStorage {
|
|
8
|
+
private externalCache;
|
|
9
|
+
constructor(externalCache: IHemiaCacheService);
|
|
10
|
+
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
11
|
+
get<T>(key: string): Promise<T | null>;
|
|
12
|
+
delete(key: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AUTH_SERVICE_ID = "AuthService";
|
|
@@ -6,7 +6,7 @@ import { AuthService } from "../services/auth.service";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class AbstractAuthController {
|
|
8
8
|
protected readonly authService: AuthService;
|
|
9
|
-
protected constructor(
|
|
9
|
+
protected constructor();
|
|
10
10
|
login(req: Request, res: Response): Promise<void>;
|
|
11
11
|
callback(req: Request, res: Response): Promise<void>;
|
|
12
12
|
me(req: Request, res: Response): Promise<Response>;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/ioc.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IAuthConfig
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
1
|
+
import { Bind, ResolutionContext } from "inversify";
|
|
2
|
+
import { IAuthConfig } from "./types";
|
|
3
|
+
import { IHemiaCacheService } from "./adapters";
|
|
4
|
+
export type CacheFactory = (context: ResolutionContext) => Promise<IHemiaCacheService> | IHemiaCacheService;
|
|
5
|
+
export declare const registerAuthSdk: (bind: Bind, config: IAuthConfig, cacheFactory: CacheFactory) => void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HMNetworkServices } from '@hemia/network-services';
|
|
2
|
+
import { JwtManager } from '@hemia/jwt-manager';
|
|
3
|
+
import { IAuthConfig, ICallbackResponse, ILoginParams, ISessionStorage, ISessionUser, IStoredState } from '../types';
|
|
3
4
|
export declare class AuthService {
|
|
4
|
-
private config;
|
|
5
|
-
private storage;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
constructor(config: IAuthConfig, storage:
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly storage;
|
|
7
|
+
private readonly networkServices;
|
|
8
|
+
private readonly jwtManager;
|
|
9
|
+
constructor(config: IAuthConfig, storage: ISessionStorage, networkServices: HMNetworkServices, jwtManager: JwtManager);
|
|
9
10
|
/**
|
|
10
11
|
* Genera los parámetros necesarios para iniciar el login SSO
|
|
11
12
|
* @param auto
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CacheService as CacheServiceClient } from "@hemia/cache-manager";
|
|
2
|
-
export declare class AuthCacheService {
|
|
3
|
-
private cacheClient;
|
|
4
|
-
constructor(cacheClient: CacheServiceClient);
|
|
5
|
-
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
|
|
6
|
-
get<T>(key: string): Promise<T | null>;
|
|
7
|
-
delete(key: string): Promise<void>;
|
|
8
|
-
}
|