Skip to content

Commit 6302566

Browse files
committed
feat(auth): add Entra ID identity provider integration
Introduces Entra ID (former Azure AD) authentication support with multiple authentication flows and automated token lifecycle management. Key additions: - Add EntraIdCredentialsProvider for handling Entra ID authentication flows - Implement MSALIdentityProvider to integrate with MSAL/EntraID authentication library - Add support for multiple authentication methods: - Managed identities (system and user-assigned) - Client credentials with certificate - Client credentials with secret - Authorization Code flow with PKCE - Add factory class with builder methods for each authentication flow - Include sample Express server implementation for Authorization Code flow - Export core auth types from client package for reuse - Add comprehensive configuration options for authority and token management Package exports (@redis/client): - Added package.json "exports" field to enable auth folder barrel exports - Included additional export paths ("./index" and "./dist/*") to maintain compatibility with existing deep imports across the monorepo packages This change enables Azure-based authentication flows while maintaining consistent token lifecycle management patterns established in the core authentication system.
1 parent 0d78fb0 commit 6302566

12 files changed

+1762
-43
lines changed

package-lock.json

+1,020-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { TokenManager, TokenManagerConfig, TokenStreamListener, RetryPolicy, IDPError } from './token-manager';
2+
export { TokenManager, TokenManagerConfig, TokenStreamListener, RetryPolicy, IDPError };
3+
import { Disposable } from './types';
4+
export { Disposable };
5+
6+
import { CredentialsProvider, StreamingCredentialsProvider, UnableToObtainNewCredentialsError, CredentialsError, StreamingCredentialsListener, AsyncCredentialsProvider, ReAuthenticationError, BasicAuth } from './credentials-provider';
7+
export { CredentialsProvider, StreamingCredentialsProvider, UnableToObtainNewCredentialsError, CredentialsError, StreamingCredentialsListener, AsyncCredentialsProvider, ReAuthenticationError, BasicAuth };
8+
9+
import { Token } from './token';
10+
export { Token };
11+
12+
import { IdentityProvider, TokenResponse } from './identity-provider';
13+
export { IdentityProvider, TokenResponse };

packages/client/lib/client/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import COMMANDS from '../commands';
2-
import { BasicAuth, CredentialsError, CredentialsProvider, StreamingCredentialsProvider, UnableToObtainNewCredentialsError } from './authx/credentials-provider';
3-
import {Disposable} from './authx/types';
2+
import { BasicAuth, CredentialsError, CredentialsProvider, StreamingCredentialsProvider, UnableToObtainNewCredentialsError, Disposable } from './authx/';
43
import RedisSocket, { RedisSocketOptions } from './socket';
54
import RedisCommandsQueue, { CommandOptions } from './commands-queue';
65
import { EventEmitter } from 'node:events';

packages/client/package.json

+26
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@
44
"license": "MIT",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"default": "./dist/index.js"
11+
},
12+
"./index": {
13+
"types": "./dist/index.d.ts",
14+
"default": "./dist/index.js"
15+
},
16+
"./authx": {
17+
"types": "./dist/lib/client/authx/index.d.ts",
18+
"default": "./dist/lib/client/authx/index.js"
19+
},
20+
"./lib/commands/generic-transformers": {
21+
"types": "./dist/lib/commands/generic-transformers.d.ts",
22+
"default": "./dist/lib/commands/generic-transformers.js"
23+
},
24+
"./dist/*": {
25+
"types": "./dist/*.d.ts",
26+
"default": "./dist/*.js"
27+
},
28+
"./lib/errors": {
29+
"types": "./dist/lib/errors.d.ts",
30+
"default": "./dist/lib/errors.js"
31+
}
32+
},
733
"files": [
834
"dist/",
935
"!dist/tsconfig.tsbuildinfo"

packages/entraid/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)