UNPKG

1.82 kBTypeScriptView Raw
1import { DeviceCheck, DeviceCheckResult } from "./deviceTrust";
2import { SecurityCheckResultMetric } from "./metrics";
3import { MetricsService } from "@aerogear/core";
4/**
5 * Service module for handling performing and reporting possible security
6 * issues in a mobile application.
7 *
8 * This requires the @aerogear/cordova-plugin-aerogear-security plugin to be
9 * included in an application.
10 */
11export declare class SecurityService {
12 private metrics?;
13 private static readonly METRICS_KEY;
14 constructor(metrics?: MetricsService | undefined);
15 /**
16 * Execute the provided security check and return the result.
17 *
18 * @returns The result of the provided check.
19 */
20 check(check: DeviceCheck): Promise<DeviceCheckResult>;
21 /**
22 * Execute the provided security check and publish the result as a metric.
23 *
24 * @return The sent metric for the check result.
25 */
26 checkAndPublishMetric(check: DeviceCheck): Promise<SecurityCheckResultMetric>;
27 /**
28 * Execute the provided security checks and return the results in an array.
29 *
30 * @returns An array of results for the provided checks.
31 */
32 checkMany(...checks: DeviceCheck[]): Promise<DeviceCheckResult[]>;
33 /**
34 * Execute the provided security checks and publish the results as metrics.
35 *
36 * @return An array of the sent metrics.
37 */
38 checkManyAndPublishMetric(...checks: DeviceCheck[]): Promise<SecurityCheckResultMetric[]>;
39 /**
40 * Publish metrics results from self defence checks to a metrics service.
41 * Application configuration must be provided to the security service on
42 * creation, otherwise metrics sending will always fail.
43 *
44 * @return Promise with the result of the underlying metrics publisher.
45 */
46 private publishCheckResultMetrics;
47}