Interface CspOriginsAPI

interface CspOriginsAPI {
    clearCache: () => void;
    createCSPEntry: (
        body: CSPEntryContent,
        options?: ApiCallOptions,
    ) => Promise<CreateCSPEntryHttpResponse>;
    deleteCSPEntry: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteCSPEntryHttpResponse>;
    getCSPEntries: (
        query: {
            childSrc?: boolean;
            connectSrc?: boolean;
            connectSrcWSS?: boolean;
            fontSrc?: boolean;
            formAction?: boolean;
            frameAncestors?: boolean;
            frameSrc?: boolean;
            imgSrc?: boolean;
            limit?: number;
            mediaSrc?: boolean;
            name?: string;
            next?: string;
            objectSrc?: boolean;
            origin?: string;
            prev?: string;
            scriptSrc?: boolean;
            sort?:
                | "origin"
                | "name"
                | "-name"
                | "-origin"
                | "createdDate"
                | "-createdDate"
                | "modifiedDate"
                | "-modifiedDate";
            styleSrc?: boolean;
            workerSrc?: boolean;
        },
        options?: ApiCallOptions,
    ) => Promise<GetCSPEntriesHttpResponse>;
    getCSPEntry: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetCSPEntryHttpResponse>;
    getCSPHeader: (
        options?: ApiCallOptions,
    ) => Promise<GetCSPHeaderHttpResponse>;
    updateCSPEntry: (
        id: string,
        body: CSPEntryContent,
        options?: ApiCallOptions,
    ) => Promise<UpdateCSPEntryHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for csp-origins api requests.

Type declaration

    • (): void
    • Clears the cache for csp-origins api requests.

      Returns void

createCSPEntry: (
    body: CSPEntryContent,
    options?: ApiCallOptions,
) => Promise<CreateCSPEntryHttpResponse>

Creates a new content security policy for an origin.

Type declaration

an object with the body content

CreateCSPEntryHttpError

deleteCSPEntry: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DeleteCSPEntryHttpResponse>

Deletes a specific content security policy.

Type declaration

The CSP entry's unique identifier.

DeleteCSPEntryHttpError

getCSPEntries: (
    query: {
        childSrc?: boolean;
        connectSrc?: boolean;
        connectSrcWSS?: boolean;
        fontSrc?: boolean;
        formAction?: boolean;
        frameAncestors?: boolean;
        frameSrc?: boolean;
        imgSrc?: boolean;
        limit?: number;
        mediaSrc?: boolean;
        name?: string;
        next?: string;
        objectSrc?: boolean;
        origin?: string;
        prev?: string;
        scriptSrc?: boolean;
        sort?:
            | "origin"
            | "name"
            | "-name"
            | "-origin"
            | "createdDate"
            | "-createdDate"
            | "modifiedDate"
            | "-modifiedDate";
        styleSrc?: boolean;
        workerSrc?: boolean;
    },
    options?: ApiCallOptions,
) => Promise<GetCSPEntriesHttpResponse>

Retrieves all content security policies for a tenant.

Type declaration

    • (
          query: {
              childSrc?: boolean;
              connectSrc?: boolean;
              connectSrcWSS?: boolean;
              fontSrc?: boolean;
              formAction?: boolean;
              frameAncestors?: boolean;
              frameSrc?: boolean;
              imgSrc?: boolean;
              limit?: number;
              mediaSrc?: boolean;
              name?: string;
              next?: string;
              objectSrc?: boolean;
              origin?: string;
              prev?: string;
              scriptSrc?: boolean;
              sort?:
                  | "origin"
                  | "name"
                  | "-name"
                  | "-origin"
                  | "createdDate"
                  | "-createdDate"
                  | "modifiedDate"
                  | "-modifiedDate";
              styleSrc?: boolean;
              workerSrc?: boolean;
          },
          options?: ApiCallOptions,
      ): Promise<GetCSPEntriesHttpResponse>
    • Retrieves all content security policies for a tenant.

      Parameters

      • query: {
            childSrc?: boolean;
            connectSrc?: boolean;
            connectSrcWSS?: boolean;
            fontSrc?: boolean;
            formAction?: boolean;
            frameAncestors?: boolean;
            frameSrc?: boolean;
            imgSrc?: boolean;
            limit?: number;
            mediaSrc?: boolean;
            name?: string;
            next?: string;
            objectSrc?: boolean;
            origin?: string;
            prev?: string;
            scriptSrc?: boolean;
            sort?:
                | "origin"
                | "name"
                | "-name"
                | "-origin"
                | "createdDate"
                | "-createdDate"
                | "modifiedDate"
                | "-modifiedDate";
            styleSrc?: boolean;
            workerSrc?: boolean;
        }

        an object with query parameters

        • OptionalchildSrc?: boolean

          Filter resources by directive 'childSrc', true/false.

        • OptionalconnectSrc?: boolean

          Filter resources by directive 'connectSrc', true/false.

        • OptionalconnectSrcWSS?: boolean

          Filter resources by directive 'connectSrcWSS', true/false.

        • OptionalfontSrc?: boolean

          Filter resources by directive 'fontSrc', true/false.

        • OptionalformAction?: boolean

          Filter resources by directive 'formAction', true/false.

        • OptionalframeAncestors?: boolean

          Filter resources by directive 'frameAncestors', true/false.

        • OptionalframeSrc?: boolean

          Filter resources by directive 'frameSrc', true/false.

        • OptionalimgSrc?: boolean

          Filter resources by directive 'imgSrc', true/false.

        • Optionallimit?: number

          Maximum number of CSP-Origins to retrieve.

        • OptionalmediaSrc?: boolean

          Filter resources by directive 'mediaSrc', true/false.

        • Optionalname?: string

          Filter resources by name (wildcard and case insensitive).

        • Optionalnext?: string

          Cursor to the next page.

        • OptionalobjectSrc?: boolean

          Filter resources by directive 'objectSrc', true/false.

        • Optionalorigin?: string

          Filter resources by origin (wildcard and case insensitive).

        • Optionalprev?: string

          Cursor to previous next page.

        • OptionalscriptSrc?: boolean

          Filter resources by directive 'scriptSrc', true/false.

        • Optionalsort?:
              | "origin"
              | "name"
              | "-name"
              | "-origin"
              | "createdDate"
              | "-createdDate"
              | "modifiedDate"
              | "-modifiedDate"

          Field to sort by, prefix with -/+ to indicate order.

        • OptionalstyleSrc?: boolean

          Filter resources by directive 'styleSrc', true/false.

        • OptionalworkerSrc?: boolean

          Filter resources by directive 'workerSrc', true/false.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetCSPEntriesHttpResponse>

      GetCSPEntriesHttpError

an object with query parameters

GetCSPEntriesHttpError

getCSPEntry: (
    id: string,
    options?: ApiCallOptions,
) => Promise<GetCSPEntryHttpResponse>

Returns details for a specific content security policy.

Type declaration

The CSP entry's unique identifier.

GetCSPEntryHttpError

getCSPHeader: (options?: ApiCallOptions) => Promise<GetCSPHeaderHttpResponse>

Retrieves the full content security policy header (including all configured policies and origins) for the tenant.

Type declaration

GetCSPHeaderHttpError

updateCSPEntry: (
    id: string,
    body: CSPEntryContent,
    options?: ApiCallOptions,
) => Promise<UpdateCSPEntryHttpResponse>

Updates a content security policy.

Type declaration

The CSP entry's unique identifier.

an object with the body content

UpdateCSPEntryHttpError