@inrupt/solid-client-authn-browser 1.17.1 → 1.17.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.
Files changed (58) hide show
  1. package/dist/ClientAuthentication.d.ts +7 -0
  2. package/dist/Session.d.ts +174 -0
  3. package/dist/constant.d.ts +2 -2
  4. package/dist/defaultSession.d.ts +70 -0
  5. package/dist/dependencies.d.ts +12 -0
  6. package/dist/index.js +833 -34
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +833 -34
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/login/oidc/AggregateOidcHandler.d.ts +10 -0
  11. package/dist/login/oidc/AggregateRedirectHandler.d.ts +10 -0
  12. package/dist/login/oidc/ClientRegistrar.d.ts +7 -0
  13. package/dist/login/oidc/IssuerConfigFetcher.d.ts +10 -0
  14. package/dist/login/oidc/OidcLoginHandler.d.ts +10 -0
  15. package/dist/login/oidc/Redirector.d.ts +7 -0
  16. package/dist/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.d.ts +3 -0
  17. package/dist/login/oidc/incomingRedirectHandler/ErrorOidcHandler.d.ts +10 -0
  18. package/dist/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.d.ts +10 -0
  19. package/dist/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.d.ts +12 -0
  20. package/dist/login/oidc/refresh/TokenRefresher.d.ts +7 -0
  21. package/dist/logout/buildRpInitiatedLogout.d.ts +7 -0
  22. package/dist/sessionInfo/SessionInfoManager.d.ts +18 -0
  23. package/dist/solid-client-authn.bundle.js +7 -7
  24. package/dist/solid-client-authn.bundle.js.map +1 -1
  25. package/dist/storage/BrowserStorage.d.ts +7 -0
  26. package/dist/storage/StorageUtility.d.ts +14 -0
  27. package/dist/util/UuidGenerator.d.ts +6 -0
  28. package/package.json +8 -8
  29. package/rollup.config.mjs +1 -1
  30. package/src/ClientAuthentication.spec.ts +106 -57
  31. package/src/ClientAuthentication.ts +18 -7
  32. package/src/Session.spec.ts +51 -54
  33. package/src/Session.ts +24 -18
  34. package/src/__mocks__/ClientAuthentication.ts +2 -2
  35. package/src/defaultSession.ts +4 -3
  36. package/src/dependencies.ts +5 -5
  37. package/src/login/oidc/ClientRegistrar.spec.ts +22 -22
  38. package/src/login/oidc/ClientRegistrar.ts +4 -2
  39. package/src/login/oidc/IssuerConfigFetcher.spec.ts +25 -25
  40. package/src/login/oidc/IssuerConfigFetcher.ts +8 -6
  41. package/src/login/oidc/OidcLoginHandler.spec.ts +15 -15
  42. package/src/login/oidc/OidcLoginHandler.ts +14 -9
  43. package/src/login/oidc/Redirector.spec.ts +1 -1
  44. package/src/login/oidc/__mocks__/ClientRegistrar.ts +3 -3
  45. package/src/login/oidc/__mocks__/IssuerConfigFetcher.ts +3 -3
  46. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.spec.ts +42 -42
  47. package/src/login/oidc/incomingRedirectHandler/AuthCodeRedirectHandler.ts +19 -13
  48. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.spec.ts +12 -12
  49. package/src/login/oidc/incomingRedirectHandler/ErrorOidcHandler.ts +2 -2
  50. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.spec.ts +7 -7
  51. package/src/login/oidc/incomingRedirectHandler/FallbackRedirectHandler.ts +2 -2
  52. package/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.spec.ts +17 -17
  53. package/src/login/oidc/refresh/TokenRefresher.spec.ts +14 -14
  54. package/src/login/oidc/refresh/TokenRefresher.ts +12 -8
  55. package/src/login/oidc/refresh/__mocks__/TokenRefresher.ts +1 -1
  56. package/src/sessionInfo/SessionInfoManager.spec.ts +37 -15
  57. package/src/sessionInfo/SessionInfoManager.ts +46 -50
  58. package/src/sessionInfo/__mocks__/SessionInfoManager.ts +3 -3
@@ -1,5 +1,15 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
5
+ /**
6
+ * Responsible for fetching an IDP configuration
7
+ */
1
8
  import type { IIssuerConfig, IIssuerConfigFetcher, IStorageUtility } from "@inrupt/solid-client-authn-core";
2
9
  export declare const WELL_KNOWN_OPENID_CONFIG = ".well-known/openid-configuration";
10
+ /**
11
+ * @hidden
12
+ */
3
13
  export default class IssuerConfigFetcher implements IIssuerConfigFetcher {
4
14
  private storageUtility;
5
15
  constructor(storageUtility: IStorageUtility);
@@ -1,4 +1,14 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
5
+ /**
6
+ * Handles Common Oidc login functions (Like fetching the configuration)
7
+ */
1
8
  import type { IClientRegistrar, IIssuerConfigFetcher, ILoginOptions, ILoginHandler, IOidcHandler, IStorageUtility, LoginResult } from "@inrupt/solid-client-authn-core";
9
+ /**
10
+ * @hidden
11
+ */
2
12
  export default class OidcLoginHandler implements ILoginHandler {
3
13
  private storageUtility;
4
14
  private oidcHandler;
@@ -1,4 +1,11 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
1
5
  import type { IRedirector, IRedirectorOptions } from "@inrupt/solid-client-authn-core";
6
+ /**
7
+ * @hidden
8
+ */
2
9
  export default class Redirector implements IRedirector {
3
10
  redirect(redirectUrl: string, options?: IRedirectorOptions): void;
4
11
  }
@@ -1,6 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import type { IClientRegistrar, IIssuerConfigFetcher, IIncomingRedirectHandler, ISessionInfoManager, IStorageUtility, ITokenRefresher, IncomingRedirectResult } from "@inrupt/solid-client-authn-core";
3
3
  import type { EventEmitter } from "events";
4
+ /**
5
+ * @hidden
6
+ */
4
7
  export declare class AuthCodeRedirectHandler implements IIncomingRedirectHandler {
5
8
  private storageUtility;
6
9
  private sessionInfoManager;
@@ -1,6 +1,16 @@
1
1
  /// <reference types="node" />
2
+ /**
3
+ * @hidden
4
+ * @packageDocumentation
5
+ */
2
6
  import type { IIncomingRedirectHandler, ISessionInfo } from "@inrupt/solid-client-authn-core";
3
7
  import type { EventEmitter } from "events";
8
+ /**
9
+ * This class handles redirect IRIs without any query params, and returns an unauthenticated
10
+ * session. It serves as a fallback so that consuming libraries don't have to test
11
+ * for the query params themselves, and can always try to use them as a redirect IRI.
12
+ * @hidden
13
+ */
4
14
  export declare class ErrorOidcHandler implements IIncomingRedirectHandler {
5
15
  canHandle(redirectUrl: string): Promise<boolean>;
6
16
  handle(redirectUrl: string, eventEmitter?: EventEmitter): Promise<ISessionInfo & {
@@ -1,4 +1,14 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
1
5
  import type { IIncomingRedirectHandler, ISessionInfo } from "@inrupt/solid-client-authn-core";
6
+ /**
7
+ * This class handles redirect IRIs without any query params, and returns an unauthenticated
8
+ * session. It serves as a fallback so that consuming libraries don't have to test
9
+ * for the query params themselves, and can always try to use them as a redirect IRI.
10
+ * @hidden
11
+ */
2
12
  export declare class FallbackRedirectHandler implements IIncomingRedirectHandler {
3
13
  canHandle(redirectUrl: string): Promise<boolean>;
4
14
  handle(_redirectUrl: string): Promise<ISessionInfo & {
@@ -1,5 +1,17 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
5
+ /**
6
+ * Handler for the Authorization Code with PKCE Flow
7
+ */
1
8
  import type { IOidcHandler, IOidcOptions, LoginResult } from "@inrupt/solid-client-authn-core";
2
9
  import { AuthorizationCodeWithPkceOidcHandlerBase } from "@inrupt/solid-client-authn-core";
10
+ /**
11
+ * @hidden
12
+ * Authorization code flow spec: https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth
13
+ * PKCE: https://tools.ietf.org/html/rfc7636
14
+ */
3
15
  export default class AuthorizationCodeWithPkceOidcHandler extends AuthorizationCodeWithPkceOidcHandlerBase implements IOidcHandler {
4
16
  handle(oidcLoginOptions: IOidcOptions): Promise<LoginResult>;
5
17
  }
@@ -1,6 +1,13 @@
1
1
  /// <reference types="node" />
2
+ /**
3
+ * @hidden
4
+ * @packageDocumentation
5
+ */
2
6
  import type { IClientRegistrar, IIssuerConfigFetcher, IStorageUtility, KeyPair, ITokenRefresher, TokenEndpointResponse } from "@inrupt/solid-client-authn-core";
3
7
  import type { EventEmitter } from "events";
8
+ /**
9
+ * @hidden
10
+ */
4
11
  export default class TokenRefresher implements ITokenRefresher {
5
12
  private storageUtility;
6
13
  private issuerConfigFetcher;
@@ -1,2 +1,9 @@
1
1
  import type { IEndSessionOptions, IRpLogoutOptions } from "@inrupt/solid-client-authn-core";
2
+ /**
3
+ * @param options.endSessionEndpoint The end_session_endpoint advertised by the server
4
+ * @param options.idTokenHint The idToken supplied by the server after logging in
5
+ * Redirects the window to the location required to perform RP initiated logout
6
+ *
7
+ * @hidden
8
+ */
2
9
  export declare function buildRpInitiatedLogout({ endSessionEndpoint, idTokenHint, }: Omit<IEndSessionOptions, keyof IRpLogoutOptions>): ({ state, postLogoutUrl }: IRpLogoutOptions) => void;
@@ -1,8 +1,26 @@
1
+ /**
2
+ * @hidden
3
+ * @packageDocumentation
4
+ */
1
5
  import type { ISessionInfo, ISessionInfoManager, ISessionInternalInfo, IStorageUtility } from "@inrupt/solid-client-authn-core";
2
6
  import { SessionInfoManagerBase } from "@inrupt/solid-client-authn-core";
3
7
  export { getUnauthenticatedSession } from "@inrupt/solid-client-authn-core";
8
+ /**
9
+ * @param sessionId
10
+ * @param storage
11
+ * @hidden
12
+ */
4
13
  export declare function clear(sessionId: string, storage: IStorageUtility): Promise<void>;
14
+ /**
15
+ * @hidden
16
+ */
5
17
  export declare class SessionInfoManager extends SessionInfoManagerBase implements ISessionInfoManager {
6
18
  get(sessionId: string): Promise<(ISessionInfo & ISessionInternalInfo) | undefined>;
19
+ /**
20
+ * This function removes all session-related information from storage.
21
+ * @param sessionId the session identifier
22
+ * @param storage the storage where session info is stored
23
+ * @hidden
24
+ */
7
25
  clear(sessionId: string): Promise<void>;
8
26
  }