config.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { CA } from './ca';
  2. import { Provider } from './identity';
  3. import { TLog } from './tlog';
  4. import { TSA } from './tsa';
  5. import * as sigstore from './types/sigstore';
  6. import type { FetchOptions, Retry } from './types/fetch';
  7. import type { KeySelector } from './verify';
  8. interface CAOptions {
  9. fulcioURL?: string;
  10. }
  11. interface TLogOptions {
  12. rekorURL?: string;
  13. }
  14. interface TSAOptions {
  15. tsaServerURL?: string;
  16. }
  17. export interface IdentityProviderOptions {
  18. identityToken?: string;
  19. oidcIssuer?: string;
  20. oidcClientID?: string;
  21. oidcClientSecret?: string;
  22. oidcRedirectURL?: string;
  23. }
  24. export type TUFOptions = {
  25. tufMirrorURL?: string;
  26. tufRootPath?: string;
  27. tufCachePath?: string;
  28. } & FetchOptions;
  29. export type SignOptions = {
  30. tlogUpload?: boolean;
  31. } & CAOptions & TLogOptions & TSAOptions & FetchOptions & IdentityProviderOptions;
  32. export type VerifyOptions = {
  33. ctLogThreshold?: number;
  34. tlogThreshold?: number;
  35. certificateIssuer?: string;
  36. certificateIdentityEmail?: string;
  37. certificateIdentityURI?: string;
  38. certificateOIDs?: Record<string, string>;
  39. keySelector?: KeySelector;
  40. } & TLogOptions & TUFOptions;
  41. export declare const DEFAULT_FULCIO_URL = "https://fulcio.sigstore.dev";
  42. export declare const DEFAULT_REKOR_URL = "https://rekor.sigstore.dev";
  43. export declare const DEFAULT_RETRY: Retry;
  44. export declare const DEFAULT_TIMEOUT = 5000;
  45. export declare function createCAClient(options: CAOptions & FetchOptions): CA;
  46. export declare function createTLogClient(options: TLogOptions & FetchOptions): TLog;
  47. export declare function createTSAClient(options: TSAOptions & FetchOptions): TSA | undefined;
  48. export declare function artifactVerificationOptions(options: VerifyOptions): sigstore.RequiredArtifactVerificationOptions;
  49. export declare function identityProviders(options: IdentityProviderOptions): Provider[];
  50. export {};