adjusted things for feedback/clarity

This commit is contained in:
BlueSkiesAndGreenPastures
2025-06-20 12:30:51 -05:00
parent bc1573cf47
commit 468d32f184
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ let cacheCursor: string | undefined
export class EventCache {
private rules = new Map<string, ToolsOzoneSafelinkDefs.Event>()
private cfg: ServiceConfig | undefined = undefined
private cfg: ServiceConfig
private pollInterval = 1 * 1000 // start at 1 second
constructor(cfg: ServiceConfig) {
+5 -5
View File
@@ -5,12 +5,12 @@ import {type ServiceConfig} from '../config'
export class OzoneAgent {
public session: CredentialSession
public agent: AtpAgent
private cfg?: ServiceConfig
private cfg: ServiceConfig
constructor(cfg: ServiceConfig) {
this.cfg = cfg
this.session = new CredentialSession(
new URL(cfg?.ozoneUrl || 'http://localhost:2583'),
new URL(cfg.ozoneUrl || 'http://localhost:2583'),
)
this.agent = new AtpAgent(this.session)
}
@@ -23,14 +23,14 @@ export class OzoneAgent {
}
public async getAgent(): Promise<AtpAgent> {
if (!this.cfg?.ozoneAgentHandle && !this.cfg?.ozoneAgentPass) {
if (!this.cfg.ozoneAgentHandle && !this.cfg.ozoneAgentPass) {
throw new Error(
'OZONE_AGENT_HANDLE and OZONE_AGENT_PASS environment variables must be set',
)
}
const identifier = this.cfg?.ozoneAgentHandle || 'did:plc:invalid'
const password = this.cfg?.ozoneAgentPass || 'invalid'
const identifier = this.cfg.ozoneAgentHandle || 'did:plc:invalid'
const password = this.cfg.ozoneAgentPass || 'invalid'
if (!this.session.hasSession) {
await this.session.login({identifier, password})