$49 GRAYBYTE WORDPRESS FILE MANAGER $33

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/sigstore/dist/

HOME
Current File : /opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/sigstore/dist//sigstore.js
"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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.verify = exports.attest = exports.sign = exports.DEFAULT_REKOR_URL = exports.DEFAULT_FULCIO_URL = exports.utils = 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 ca_1 = require("./ca");
const identity_1 = __importDefault(require("./identity"));
const sign_1 = require("./sign");
const tlog_1 = require("./tlog");
const tuf = __importStar(require("./tuf"));
const sigstore = __importStar(require("./types/sigstore"));
const util_1 = require("./util");
const verify_1 = require("./verify");
exports.utils = __importStar(require("./sigstore-utils"));
exports.DEFAULT_FULCIO_URL = 'https://fulcio.sigstore.dev';
exports.DEFAULT_REKOR_URL = 'https://rekor.sigstore.dev';
function createCAClient(options) {
    return new ca_1.CAClient({
        fulcioBaseURL: options.fulcioURL || exports.DEFAULT_FULCIO_URL,
    });
}
function createTLogClient(options) {
    return new tlog_1.TLogClient({
        rekorBaseURL: options.rekorURL || exports.DEFAULT_REKOR_URL,
    });
}
const tufCacheDir = util_1.appdata.appDataPath('sigstore-js');
async function sign(payload, options = {}) {
    const ca = createCAClient(options);
    const tlog = createTLogClient(options);
    const idps = configureIdentityProviders(options);
    const signer = new sign_1.Signer({
        ca,
        tlog,
        identityProviders: idps,
    });
    const bundle = await signer.signBlob(payload);
    return sigstore.Bundle.toJSON(bundle);
}
exports.sign = sign;
async function attest(payload, payloadType, options = {}) {
    const ca = createCAClient(options);
    const tlog = createTLogClient(options);
    const idps = configureIdentityProviders(options);
    const signer = new sign_1.Signer({
        ca,
        tlog,
        identityProviders: idps,
    });
    const bundle = await signer.signAttestation(payload, payloadType);
    return sigstore.Bundle.toJSON(bundle);
}
exports.attest = attest;
async function verify(bundle, payload, options = {}) {
    const trustedRoot = await tuf.getTrustedRoot(tufCacheDir, {
        mirrorURL: options.tufMirrorURL,
        rootPath: options.tufRootPath,
    });
    const verifier = new verify_1.Verifier(trustedRoot, options.keySelector);
    const deserializedBundle = sigstore.bundleFromJSON(bundle);
    const opts = collectArtifactVerificationOptions(options);
    return verifier.verify(deserializedBundle, opts, payload);
}
exports.verify = verify;
// Translates the IdenityProviderOptions into a list of Providers which
// should be queried to retrieve an identity token.
function configureIdentityProviders(options) {
    const idps = [];
    const token = options.identityToken;
    // If an explicit identity token is provided, use that. Setup a dummy
    // provider that just returns the token. Otherwise, setup the CI context
    // provider and (optionally) the OAuth provider.
    if (token) {
        idps.push({ getToken: () => Promise.resolve(token) });
    }
    else {
        idps.push(identity_1.default.ciContextProvider());
        if (options.oidcIssuer && options.oidcClientID) {
            idps.push(identity_1.default.oauthProvider({
                issuer: options.oidcIssuer,
                clientID: options.oidcClientID,
                clientSecret: options.oidcClientSecret,
                redirectURL: options.oidcRedirectURL,
            }));
        }
    }
    return idps;
}
// Assembles the AtifactVerificationOptions from the supplied VerifyOptions.
function collectArtifactVerificationOptions(options) {
    // The trusted signers are only used if the options contain a certificate
    // issuer
    let signers;
    if (options.certificateIssuer) {
        let san = undefined;
        if (options.certificateIdentityEmail) {
            san = {
                type: sigstore.SubjectAlternativeNameType.EMAIL,
                identity: {
                    $case: 'value',
                    value: options.certificateIdentityEmail,
                },
            };
        }
        else if (options.certificateIdentityURI) {
            san = {
                type: sigstore.SubjectAlternativeNameType.URI,
                identity: {
                    $case: 'value',
                    value: options.certificateIdentityURI,
                },
            };
        }
        const oids = Object.entries(options.certificateOIDs || {}).map(([oid, value]) => ({
            oid: { id: oid.split('.').map((s) => parseInt(s, 10)) },
            value: Buffer.from(value),
        }));
        signers = {
            $case: 'certificateIdentities',
            certificateIdentities: {
                identities: [
                    {
                        issuer: options.certificateIssuer,
                        san: san,
                        oids: oids,
                    },
                ],
            },
        };
    }
    // Construct the artifact verification options w/ defaults
    return {
        ctlogOptions: {
            disable: false,
            threshold: options.ctLogThreshold || 1,
            detachedSct: false,
        },
        tlogOptions: {
            disable: false,
            threshold: options.tlogThreshold || 1,
            performOnlineVerification: false,
        },
        signers,
    };
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
ca
--
31 Aug 2024 8.02 AM
root / root
0755
cli
--
31 Aug 2024 8.02 AM
root / root
0755
client
--
31 Aug 2024 8.02 AM
root / root
0755
identity
--
31 Aug 2024 8.02 AM
root / root
0755
merkle
--
31 Aug 2024 8.02 AM
root / root
0755
tlog
--
31 Aug 2024 8.02 AM
root / root
0755
tuf
--
31 Aug 2024 8.02 AM
root / root
0755
types
--
31 Aug 2024 8.02 AM
root / root
0755
util
--
31 Aug 2024 8.02 AM
root / root
0755
x509
--
31 Aug 2024 8.02 AM
root / root
0755
error.d.ts
0.352 KB
7 Dec 2023 1.07 AM
root / root
0644
error.js
1.283 KB
7 Dec 2023 1.07 AM
root / root
0644
index.d.ts
0.039 KB
7 Dec 2023 1.07 AM
root / root
0644
index.js
1.714 KB
7 Dec 2023 1.07 AM
root / root
0644
sign.d.ts
0.668 KB
7 Dec 2023 1.07 AM
root / root
0644
sign.js
2.769 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore-utils.d.ts
0.394 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore-utils.js
2.288 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore.d.ts
1.351 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore.js
6.85 KB
7 Dec 2023 1.07 AM
root / root
0644
verify.d.ts
0.55 KB
7 Dec 2023 1.07 AM
root / root
0644
verify.js
6.594 KB
7 Dec 2023 1.07 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF