config.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { DSSEBundleBuilder, IdentityProvider, MessageSignatureBundleBuilder } from '@sigstore/sign';
  2. import { KeyFinderFunc, VerificationPolicy } from '@sigstore/verify';
  3. import type { MakeFetchHappenOptions } from 'make-fetch-happen';
  4. type Retry = MakeFetchHappenOptions['retry'];
  5. type FetchOptions = {
  6. retry?: Retry;
  7. timeout?: number | undefined;
  8. };
  9. type KeySelector = (hint: string) => string | Buffer | undefined;
  10. export type SignOptions = {
  11. fulcioURL?: string;
  12. identityProvider?: IdentityProvider;
  13. identityToken?: string;
  14. rekorURL?: string;
  15. tlogUpload?: boolean;
  16. tsaServerURL?: string;
  17. legacyCompatibility?: boolean;
  18. } & FetchOptions;
  19. export type VerifyOptions = {
  20. ctLogThreshold?: number;
  21. tlogThreshold?: number;
  22. certificateIssuer?: string;
  23. certificateIdentityEmail?: string;
  24. certificateIdentityURI?: string;
  25. certificateOIDs?: Record<string, string>;
  26. keySelector?: KeySelector;
  27. tufMirrorURL?: string;
  28. tufRootPath?: string;
  29. tufCachePath?: string;
  30. tufForceCache?: boolean;
  31. } & FetchOptions;
  32. export declare const DEFAULT_RETRY: Retry;
  33. export declare const DEFAULT_TIMEOUT = 5000;
  34. export declare function createBundleBuilder(bundleType: 'messageSignature', options: SignOptions): MessageSignatureBundleBuilder;
  35. export declare function createBundleBuilder(bundleType: 'dsseEnvelope', options: SignOptions): DSSEBundleBuilder;
  36. export declare function createKeyFinder(keySelector: KeySelector): KeyFinderFunc;
  37. export declare function createVerificationPolicy(options: VerifyOptions): VerificationPolicy;
  38. export {};