diff --git a/docs/architecture/iptvnator-ui-guidelines.md b/docs/architecture/iptvnator-ui-guidelines.md index ef7c2f1c4..d7bfcf878 100644 --- a/docs/architecture/iptvnator-ui-guidelines.md +++ b/docs/architecture/iptvnator-ui-guidelines.md @@ -1372,7 +1372,8 @@ in `@iptvnator/playlist/shared/util` (`source-display`, `source-format`, - **No credentials on screen.** Names come from `sourceDisplayName`: a URL, a URL-derived name such as `get.php?username=…&password=…` or any name holding the source's password, MAC or URL secrets becomes the host. URLs come from - `sourceDisplayUrl`, built on `stripUrlCredentials` (shared logging): no + `sourceDisplayUrl`, built on `stripUrlCredentials` (beside it in + `source-display`, out of the eager logging barrel): no userinfo, sensitive query or fragment parameters, or Xtream path credentials; Xtream shows `scheme://host:port · username`. Copy URL copies the full address on request. diff --git a/libs/playlist/shared/util/src/lib/source-display/source-display.ts b/libs/playlist/shared/util/src/lib/source-display/source-display.ts index 590386d10..692521d1b 100644 --- a/libs/playlist/shared/util/src/lib/source-display/source-display.ts +++ b/libs/playlist/shared/util/src/lib/source-display/source-display.ts @@ -1,10 +1,11 @@ -import { isSensitiveKey, stripUrlCredentials } from '@iptvnator/shared/logging'; +import { isSensitiveKey } from '@iptvnator/shared/logging'; import { PlaylistMeta, playlistDisplayLabel, playlistNameHasCredentials, resolvePlaylistSourceKind, } from '@iptvnator/shared/interfaces'; +import { stripUrlCredentials } from './strip-url-credentials'; export type SourceDisplayFields = Partial< Pick< diff --git a/libs/shared/logging/src/lib/strip-url-credentials.spec.ts b/libs/playlist/shared/util/src/lib/source-display/strip-url-credentials.spec.ts similarity index 100% rename from libs/shared/logging/src/lib/strip-url-credentials.spec.ts rename to libs/playlist/shared/util/src/lib/source-display/strip-url-credentials.spec.ts diff --git a/libs/shared/logging/src/lib/strip-url-credentials.ts b/libs/playlist/shared/util/src/lib/source-display/strip-url-credentials.ts similarity index 94% rename from libs/shared/logging/src/lib/strip-url-credentials.ts rename to libs/playlist/shared/util/src/lib/source-display/strip-url-credentials.ts index c05b43a6d..eece7dbe5 100644 --- a/libs/shared/logging/src/lib/strip-url-credentials.ts +++ b/libs/playlist/shared/util/src/lib/source-display/strip-url-credentials.ts @@ -2,7 +2,7 @@ import { isSensitiveKey, looksLikeSearchParams, XTREAM_CREDENTIAL_PATH_SEGMENTS, -} from './redact-sensitive-data'; +} from '@iptvnator/shared/logging'; /** * Short account keys some playlist URLs use. A log line keeps them for @@ -131,7 +131,10 @@ function stripUrl(value: string, depth: number): string | null { } /** - * A URL safe to show on screen. Where the log redactor replaces secrets with + * A URL safe to show on screen. It lives beside its only consumer + * (`source-display`): behind the shared logging barrel, which startup code + * imports, it rode into the initial bundle. + * Where the log redactor replaces secrets with * a marker, this drops them: the userinfo, every query or fragment parameter * the redactor treats as sensitive (`username`, `password`, `token`, `mac`, * …), and the two account segments after `/live/`, `/movie/`, `/series/` or diff --git a/libs/shared/logging/src/index.ts b/libs/shared/logging/src/index.ts index 4a5510b15..a698d06da 100644 --- a/libs/shared/logging/src/index.ts +++ b/libs/shared/logging/src/index.ts @@ -1,7 +1,9 @@ export { isSensitiveKey, + looksLikeSearchParams, REDACTED_VALUE, redactSensitiveData, + XTREAM_CREDENTIAL_PATH_SEGMENTS, } from './lib/redact-sensitive-data'; export type { RedactionOptions } from './lib/redact-sensitive-data'; export { @@ -25,4 +27,3 @@ export type { RendererPerformancePhaseMetadata, RendererPerformancePhaseOutcome, } from './lib/renderer-performance-phase'; -export { stripUrlCredentials } from './lib/strip-url-credentials';