@svadmin/sso 0.8.6 → 0.8.8

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 (2) hide show
  1. package/package.json +12 -3
  2. package/src/presets.test.ts +0 -92
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/sso",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "type": "module",
5
5
  "description": "OIDC/OAuth2 SSO AuthProvider plugin for svadmin — supports Okta, Azure AD, Cognito, Keycloak, Google",
6
6
  "license": "MIT",
@@ -28,12 +28,21 @@
28
28
  "main": "./src/index.ts",
29
29
  "types": "./src/index.ts",
30
30
  "files": [
31
- "src"
31
+ "src/**/*.ts",
32
+ "!src/**/*.test.*",
33
+ "!src/**/*.spec.*",
34
+ "!src/**/vitest.config.*",
35
+ "!src/**/setupTest.*"
32
36
  ],
33
37
  "peerDependencies": {
34
- "@svadmin/core": "^0.22.1"
38
+ "@svadmin/core": "^0.25.3"
35
39
  },
36
40
  "devDependencies": {
37
41
  "typescript": "^5.7.0"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "@svadmin/core": {
45
+ "optional": true
46
+ }
38
47
  }
39
48
  }
@@ -1,92 +0,0 @@
1
- /**
2
- * @svadmin/sso — Presets Unit Tests
3
- */
4
- import { describe, test, expect } from 'bun:test';
5
- import type { TokenStorage } from './auth-provider';
6
-
7
- // In-memory storage for tests (localStorage not available in Bun test)
8
- function createMemoryStorage(): TokenStorage {
9
- const store = new Map<string, string>();
10
- return {
11
- getItem: (key: string) => store.get(key) ?? null,
12
- setItem: (key: string, value: string) => { store.set(key, value); },
13
- removeItem: (key: string) => { store.delete(key); },
14
- };
15
- }
16
-
17
- describe('SSO presets', () => {
18
- // Import the module to verify it compiles correctly
19
- test('presets module exports all factories', async () => {
20
- const presets = await import('./presets');
21
- expect(typeof presets.createGoogleAuth).toBe('function');
22
- expect(typeof presets.createMicrosoftAuth).toBe('function');
23
- expect(typeof presets.createGitHubAuth).toBe('function');
24
- expect(typeof presets.createGitLabAuth).toBe('function');
25
- expect(typeof presets.createKeycloakAuth).toBe('function');
26
- expect(typeof presets.createAuth0Auth).toBe('function');
27
- });
28
-
29
- test('createGoogleAuth returns AuthProvider', async () => {
30
- const { createGoogleAuth } = await import('./presets');
31
- const provider = createGoogleAuth('test-client-id', {
32
- redirectUri: 'http://localhost/callback',
33
- storage: createMemoryStorage(),
34
- });
35
- expect(provider).toBeTruthy();
36
- expect(typeof provider.login).toBe('function');
37
- expect(typeof provider.logout).toBe('function');
38
- expect(typeof provider.check).toBe('function');
39
- expect(typeof provider.getIdentity).toBe('function');
40
- });
41
-
42
- test('createMicrosoftAuth accepts tenantId', async () => {
43
- const { createMicrosoftAuth } = await import('./presets');
44
- const provider = createMicrosoftAuth('test-id', 'my-tenant', {
45
- redirectUri: 'http://localhost/callback',
46
- storage: createMemoryStorage(),
47
- });
48
- expect(provider).toBeTruthy();
49
- expect(typeof provider.login).toBe('function');
50
- });
51
-
52
- test('createGitHubAuth returns AuthProvider', async () => {
53
- const { createGitHubAuth } = await import('./presets');
54
- const provider = createGitHubAuth('test-github-id', {
55
- redirectUri: 'http://localhost/callback',
56
- storage: createMemoryStorage(),
57
- });
58
- expect(provider).toBeTruthy();
59
- expect(typeof provider.login).toBe('function');
60
- expect(typeof provider.getIdentity).toBe('function');
61
- });
62
-
63
- test('createKeycloakAuth returns AuthProvider', async () => {
64
- const { createKeycloakAuth } = await import('./presets');
65
- const provider = createKeycloakAuth('https://kc.example.com', 'my-realm', 'client-id', {
66
- redirectUri: 'http://localhost/callback',
67
- storage: createMemoryStorage(),
68
- });
69
- expect(provider).toBeTruthy();
70
- expect(typeof provider.login).toBe('function');
71
- });
72
-
73
- test('createAuth0Auth returns AuthProvider', async () => {
74
- const { createAuth0Auth } = await import('./presets');
75
- const provider = createAuth0Auth('my-tenant.auth0.com', 'client-id', {
76
- redirectUri: 'http://localhost/callback',
77
- storage: createMemoryStorage(),
78
- });
79
- expect(provider).toBeTruthy();
80
- expect(typeof provider.login).toBe('function');
81
- });
82
-
83
- test('createGitLabAuth returns AuthProvider', async () => {
84
- const { createGitLabAuth } = await import('./presets');
85
- const provider = createGitLabAuth('test-id', 'https://gitlab.example.com', {
86
- redirectUri: 'http://localhost/callback',
87
- storage: createMemoryStorage(),
88
- });
89
- expect(provider).toBeTruthy();
90
- expect(typeof provider.login).toBe('function');
91
- });
92
- });