mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
a5d24f395e
Convert all TypeScript `private` and `private readonly` declarations to ES6 `#` syntax for true runtime privacy. TypeScript's `private` keyword only provides compile-time checking but fields remain accessible in compiled JavaScript.
25 lines
661 B
TypeScript
25 lines
661 B
TypeScript
import type { CoreService, EncryptionService } from '../core/tokens'
|
|
|
|
/**
|
|
* Encryption module — bootstrap page/shortcode decryption via FixItDecryptor.
|
|
*
|
|
* Responsibilities:
|
|
* - Initialize FixItDecryptor for full-page and shortcode-scoped decryption.
|
|
*/
|
|
export class EncryptionModule implements EncryptionService {
|
|
#core: CoreService
|
|
|
|
constructor(core: CoreService) {
|
|
this.#core = core
|
|
}
|
|
|
|
/** Initialize FixItDecryptor with encryption config. */
|
|
setup() {
|
|
if (!this.#core.config.encryption || !window.FixItDecryptor)
|
|
return
|
|
const decryptor = new window.FixItDecryptor()
|
|
|
|
decryptor.init(this.#core.config.encryption)
|
|
}
|
|
}
|