Skip to content

Commit

Permalink
OWASP ZAP セッション関連の抽象化
Browse files Browse the repository at this point in the history
- ZapClient::startSession() を追加
  • Loading branch information
nanasess committed Mar 15, 2022
1 parent 4b76107 commit b97bc50
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e-tests/utils/ZapClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,22 @@ export class ZapClient {
const result = await this.zaproxy.core.alerts(url, start, count, riskid);
return result.alerts;
}

public async startSession(contextType: ContextType, sessionName: string): Promise<void> {
await this.setMode(Mode.Protect);
await this.newSession(`/zap/wrk/sessions/${sessionName}`, true);
await this.importContext(contextType);

switch (contextType) {
case ContextType.Admin:
case ContextType.FrontLogin:
if (!await this.isForcedUserModeEnabled()) {
await this.setForcedUserModeEnabled();
}
break;

default:
case ContextType.FrontGuest:
}
}
}

0 comments on commit b97bc50

Please sign in to comment.