Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
38
node_modules/sigstore/dist/config.d.ts
generated
vendored
Normal file
38
node_modules/sigstore/dist/config.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
/// <reference types="node" />
|
||||
import { DSSEBundleBuilder, IdentityProvider, MessageSignatureBundleBuilder } from '@sigstore/sign';
|
||||
import { KeyFinderFunc, VerificationPolicy } from '@sigstore/verify';
|
||||
import type { MakeFetchHappenOptions } from 'make-fetch-happen';
|
||||
type Retry = MakeFetchHappenOptions['retry'];
|
||||
type FetchOptions = {
|
||||
retry?: Retry;
|
||||
timeout?: number | undefined;
|
||||
};
|
||||
type KeySelector = (hint: string) => string | Buffer | undefined;
|
||||
export type SignOptions = {
|
||||
fulcioURL?: string;
|
||||
identityProvider?: IdentityProvider;
|
||||
identityToken?: string;
|
||||
rekorURL?: string;
|
||||
tlogUpload?: boolean;
|
||||
tsaServerURL?: string;
|
||||
} & FetchOptions;
|
||||
export type VerifyOptions = {
|
||||
ctLogThreshold?: number;
|
||||
tlogThreshold?: number;
|
||||
certificateIssuer?: string;
|
||||
certificateIdentityEmail?: string;
|
||||
certificateIdentityURI?: string;
|
||||
certificateOIDs?: Record<string, string>;
|
||||
keySelector?: KeySelector;
|
||||
tufMirrorURL?: string;
|
||||
tufRootPath?: string;
|
||||
tufCachePath?: string;
|
||||
tufForceCache?: boolean;
|
||||
} & FetchOptions;
|
||||
export declare const DEFAULT_RETRY: Retry;
|
||||
export declare const DEFAULT_TIMEOUT = 5000;
|
||||
export declare function createBundleBuilder(bundleType: 'messageSignature', options: SignOptions): MessageSignatureBundleBuilder;
|
||||
export declare function createBundleBuilder(bundleType: 'dsseEnvelope', options: SignOptions): DSSEBundleBuilder;
|
||||
export declare function createKeyFinder(keySelector: KeySelector): KeyFinderFunc;
|
||||
export declare function createVerificationPolicy(options: VerifyOptions): VerificationPolicy;
|
||||
export {};
|
116
node_modules/sigstore/dist/config.js
generated
vendored
Normal file
116
node_modules/sigstore/dist/config.js
generated
vendored
Normal file
|
@ -0,0 +1,116 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createVerificationPolicy = exports.createKeyFinder = exports.createBundleBuilder = exports.DEFAULT_TIMEOUT = exports.DEFAULT_RETRY = void 0;
|
||||
/*
|
||||
Copyright 2023 The Sigstore Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
const core_1 = require("@sigstore/core");
|
||||
const sign_1 = require("@sigstore/sign");
|
||||
const verify_1 = require("@sigstore/verify");
|
||||
exports.DEFAULT_RETRY = { retries: 2 };
|
||||
exports.DEFAULT_TIMEOUT = 5000;
|
||||
function createBundleBuilder(bundleType, options) {
|
||||
const bundlerOptions = {
|
||||
signer: initSigner(options),
|
||||
witnesses: initWitnesses(options),
|
||||
};
|
||||
switch (bundleType) {
|
||||
case 'messageSignature':
|
||||
return new sign_1.MessageSignatureBundleBuilder(bundlerOptions);
|
||||
case 'dsseEnvelope':
|
||||
return new sign_1.DSSEBundleBuilder(bundlerOptions);
|
||||
}
|
||||
}
|
||||
exports.createBundleBuilder = createBundleBuilder;
|
||||
// Translates the public KeySelector type into the KeyFinderFunc type needed by
|
||||
// the verifier.
|
||||
function createKeyFinder(keySelector) {
|
||||
return (hint) => {
|
||||
const key = keySelector(hint);
|
||||
if (!key) {
|
||||
throw new verify_1.VerificationError({
|
||||
code: 'PUBLIC_KEY_ERROR',
|
||||
message: `key not found: ${hint}`,
|
||||
});
|
||||
}
|
||||
return {
|
||||
publicKey: core_1.crypto.createPublicKey(key),
|
||||
validFor: () => true,
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.createKeyFinder = createKeyFinder;
|
||||
function createVerificationPolicy(options) {
|
||||
const policy = {};
|
||||
const san = options.certificateIdentityEmail || options.certificateIdentityURI;
|
||||
if (san) {
|
||||
policy.subjectAlternativeName = san;
|
||||
}
|
||||
if (options.certificateIssuer) {
|
||||
policy.extensions = { issuer: options.certificateIssuer };
|
||||
}
|
||||
return policy;
|
||||
}
|
||||
exports.createVerificationPolicy = createVerificationPolicy;
|
||||
// Instantiate the FulcioSigner based on the supplied options.
|
||||
function initSigner(options) {
|
||||
return new sign_1.FulcioSigner({
|
||||
fulcioBaseURL: options.fulcioURL,
|
||||
identityProvider: options.identityProvider || initIdentityProvider(options),
|
||||
retry: options.retry ?? exports.DEFAULT_RETRY,
|
||||
timeout: options.timeout ?? exports.DEFAULT_TIMEOUT,
|
||||
});
|
||||
}
|
||||
// Instantiate an identity provider based on the supplied options. If an
|
||||
// explicit identity token is provided, use that. Otherwise, use the CI
|
||||
// context provider.
|
||||
function initIdentityProvider(options) {
|
||||
const token = options.identityToken;
|
||||
if (token) {
|
||||
/* istanbul ignore next */
|
||||
return { getToken: () => Promise.resolve(token) };
|
||||
}
|
||||
else {
|
||||
return new sign_1.CIContextProvider('sigstore');
|
||||
}
|
||||
}
|
||||
// Instantiate a collection of witnesses based on the supplied options.
|
||||
function initWitnesses(options) {
|
||||
const witnesses = [];
|
||||
if (isRekorEnabled(options)) {
|
||||
witnesses.push(new sign_1.RekorWitness({
|
||||
rekorBaseURL: options.rekorURL,
|
||||
fetchOnConflict: false,
|
||||
retry: options.retry ?? exports.DEFAULT_RETRY,
|
||||
timeout: options.timeout ?? exports.DEFAULT_TIMEOUT,
|
||||
}));
|
||||
}
|
||||
if (isTSAEnabled(options)) {
|
||||
witnesses.push(new sign_1.TSAWitness({
|
||||
tsaBaseURL: options.tsaServerURL,
|
||||
retry: options.retry ?? exports.DEFAULT_RETRY,
|
||||
timeout: options.timeout ?? exports.DEFAULT_TIMEOUT,
|
||||
}));
|
||||
}
|
||||
return witnesses;
|
||||
}
|
||||
// Type assertion to ensure that Rekor is enabled
|
||||
function isRekorEnabled(options) {
|
||||
return options.tlogUpload !== false;
|
||||
}
|
||||
// Type assertion to ensure that TSA is enabled
|
||||
function isTSAEnabled(options) {
|
||||
return options.tsaServerURL !== undefined;
|
||||
}
|
9
node_modules/sigstore/dist/index.d.ts
generated
vendored
Normal file
9
node_modules/sigstore/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export { ValidationError } from '@sigstore/bundle';
|
||||
export { DEFAULT_FULCIO_URL, DEFAULT_REKOR_URL, InternalError, } from '@sigstore/sign';
|
||||
export { TUFError } from '@sigstore/tuf';
|
||||
export { PolicyError, VerificationError } from '@sigstore/verify';
|
||||
export { attest, createVerifier, sign, verify } from './sigstore';
|
||||
export type { SerializedBundle as Bundle } from '@sigstore/bundle';
|
||||
export type { IdentityProvider } from '@sigstore/sign';
|
||||
export type { SignOptions, VerifyOptions } from './config';
|
||||
export type { BundleVerifier } from './sigstore';
|
34
node_modules/sigstore/dist/index.js
generated
vendored
Normal file
34
node_modules/sigstore/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.verify = exports.sign = exports.createVerifier = exports.attest = exports.VerificationError = exports.PolicyError = exports.TUFError = exports.InternalError = exports.DEFAULT_REKOR_URL = exports.DEFAULT_FULCIO_URL = exports.ValidationError = void 0;
|
||||
/*
|
||||
Copyright 2022 The Sigstore Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
var bundle_1 = require("@sigstore/bundle");
|
||||
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return bundle_1.ValidationError; } });
|
||||
var sign_1 = require("@sigstore/sign");
|
||||
Object.defineProperty(exports, "DEFAULT_FULCIO_URL", { enumerable: true, get: function () { return sign_1.DEFAULT_FULCIO_URL; } });
|
||||
Object.defineProperty(exports, "DEFAULT_REKOR_URL", { enumerable: true, get: function () { return sign_1.DEFAULT_REKOR_URL; } });
|
||||
Object.defineProperty(exports, "InternalError", { enumerable: true, get: function () { return sign_1.InternalError; } });
|
||||
var tuf_1 = require("@sigstore/tuf");
|
||||
Object.defineProperty(exports, "TUFError", { enumerable: true, get: function () { return tuf_1.TUFError; } });
|
||||
var verify_1 = require("@sigstore/verify");
|
||||
Object.defineProperty(exports, "PolicyError", { enumerable: true, get: function () { return verify_1.PolicyError; } });
|
||||
Object.defineProperty(exports, "VerificationError", { enumerable: true, get: function () { return verify_1.VerificationError; } });
|
||||
var sigstore_1 = require("./sigstore");
|
||||
Object.defineProperty(exports, "attest", { enumerable: true, get: function () { return sigstore_1.attest; } });
|
||||
Object.defineProperty(exports, "createVerifier", { enumerable: true, get: function () { return sigstore_1.createVerifier; } });
|
||||
Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return sigstore_1.sign; } });
|
||||
Object.defineProperty(exports, "verify", { enumerable: true, get: function () { return sigstore_1.verify; } });
|
11
node_modules/sigstore/dist/sigstore.d.ts
generated
vendored
Normal file
11
node_modules/sigstore/dist/sigstore.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
/// <reference types="node" />
|
||||
import { SerializedBundle } from '@sigstore/bundle';
|
||||
import * as config from './config';
|
||||
export declare function sign(payload: Buffer, options?: config.SignOptions): Promise<SerializedBundle>;
|
||||
export declare function attest(payload: Buffer, payloadType: string, options?: config.SignOptions): Promise<SerializedBundle>;
|
||||
export declare function verify(bundle: SerializedBundle, options?: config.VerifyOptions): Promise<void>;
|
||||
export declare function verify(bundle: SerializedBundle, data: Buffer, options?: config.VerifyOptions): Promise<void>;
|
||||
export interface BundleVerifier {
|
||||
verify(bundle: SerializedBundle, data?: Buffer): void;
|
||||
}
|
||||
export declare function createVerifier(options?: config.VerifyOptions): Promise<BundleVerifier>;
|
103
node_modules/sigstore/dist/sigstore.js
generated
vendored
Normal file
103
node_modules/sigstore/dist/sigstore.js
generated
vendored
Normal file
|
@ -0,0 +1,103 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createVerifier = exports.verify = exports.attest = exports.sign = void 0;
|
||||
/*
|
||||
Copyright 2023 The Sigstore Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
const bundle_1 = require("@sigstore/bundle");
|
||||
const tuf = __importStar(require("@sigstore/tuf"));
|
||||
const verify_1 = require("@sigstore/verify");
|
||||
const config = __importStar(require("./config"));
|
||||
async function sign(payload,
|
||||
/* istanbul ignore next */
|
||||
options = {}) {
|
||||
const bundler = config.createBundleBuilder('messageSignature', options);
|
||||
const bundle = await bundler.create({ data: payload });
|
||||
return (0, bundle_1.bundleToJSON)(bundle);
|
||||
}
|
||||
exports.sign = sign;
|
||||
async function attest(payload, payloadType,
|
||||
/* istanbul ignore next */
|
||||
options = {}) {
|
||||
const bundler = config.createBundleBuilder('dsseEnvelope', options);
|
||||
const bundle = await bundler.create({ data: payload, type: payloadType });
|
||||
return (0, bundle_1.bundleToJSON)(bundle);
|
||||
}
|
||||
exports.attest = attest;
|
||||
async function verify(bundle, dataOrOptions, options) {
|
||||
let data;
|
||||
if (Buffer.isBuffer(dataOrOptions)) {
|
||||
data = dataOrOptions;
|
||||
}
|
||||
else {
|
||||
options = dataOrOptions;
|
||||
}
|
||||
return createVerifier(options).then((verifier) => verifier.verify(bundle, data));
|
||||
}
|
||||
exports.verify = verify;
|
||||
async function createVerifier(
|
||||
/* istanbul ignore next */
|
||||
options = {}) {
|
||||
const trustedRoot = await tuf.getTrustedRoot({
|
||||
mirrorURL: options.tufMirrorURL,
|
||||
rootPath: options.tufRootPath,
|
||||
cachePath: options.tufCachePath,
|
||||
forceCache: options.tufForceCache,
|
||||
retry: options.retry ?? config.DEFAULT_RETRY,
|
||||
timeout: options.timeout ?? config.DEFAULT_TIMEOUT,
|
||||
});
|
||||
const keyFinder = options.keySelector
|
||||
? config.createKeyFinder(options.keySelector)
|
||||
: undefined;
|
||||
const trustMaterial = (0, verify_1.toTrustMaterial)(trustedRoot, keyFinder);
|
||||
const verifierOptions = {
|
||||
ctlogThreshold: options.ctLogThreshold,
|
||||
tlogThreshold: options.tlogThreshold,
|
||||
};
|
||||
const verifier = new verify_1.Verifier(trustMaterial, verifierOptions);
|
||||
const policy = config.createVerificationPolicy(options);
|
||||
return {
|
||||
verify: (bundle, payload) => {
|
||||
const deserializedBundle = (0, bundle_1.bundleFromJSON)(bundle);
|
||||
const signedEntity = (0, verify_1.toSignedEntity)(deserializedBundle, payload);
|
||||
verifier.verify(signedEntity, policy);
|
||||
return;
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.createVerifier = createVerifier;
|
Loading…
Add table
Add a link
Reference in a new issue