Skip to content

Commit

Permalink
try pre-submit test fix
Browse files Browse the repository at this point in the history
Signed-off-by: Noah Elzner <[email protected]>
  • Loading branch information
enteraga6 committed Mar 28, 2024
1 parent abddee9 commit f52ab2f
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/actions/sign-attestations/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const sigstore = __importStar(__nccwpck_require__(9149));
const sigstore_1 = __nccwpck_require__(9149);
const path = __importStar(__nccwpck_require__(1017));
const tscommon = __importStar(__nccwpck_require__(6634));
function run() {
Expand All @@ -78,7 +78,7 @@ function run() {
if (stat.isFile()) {
core.debug(`Signing ${fpath}...`);
const buffer = tscommon.safeReadFileSync(fpath);
const bundle = yield sigstore.attest(buffer, payloadType);
const bundle = yield (0, sigstore_1.attest)(buffer, payloadType);
const bundleStr = JSON.stringify(bundle);
const outputPath = path.join(outputFolder, `${path.basename(fpath)}.build.slsa`);
// We detect path traversal for outputPath in safeWriteFileSync.
Expand All @@ -88,7 +88,7 @@ function run() {
}
}
catch (error) {
if (error instanceof sigstore.InternalError) {
if (error instanceof sigstore_1.InternalError) {
core.setFailed(`${error}: ${error.cause}`);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/sign-attestations/dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions .github/actions/sign-attestations/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import * as core from "@actions/core";
import * as sigstore from "sigstore";
import { attest, InternalError } from "sigstore";
import * as path from "path";
import * as tscommon from "tscommon";

Expand Down Expand Up @@ -41,7 +41,7 @@ async function run(): Promise<void> {
if (stat.isFile()) {
core.debug(`Signing ${fpath}...`);
const buffer = tscommon.safeReadFileSync(fpath);
const bundle = await sigstore.attest(buffer, payloadType);
const bundle = await attest(buffer, payloadType);
const bundleStr = JSON.stringify(bundle);
const outputPath = path.join(
outputFolder,
Expand All @@ -53,7 +53,7 @@ async function run(): Promise<void> {
}
}
} catch (error) {
if (error instanceof sigstore.InternalError) {
if (error instanceof InternalError) {
core.setFailed(`${error}: ${error.cause}`);
} else {
core.setFailed(`Unexpected error: ${error}`);
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/verify-token/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const sigstore = __importStar(__nccwpck_require__(9149));
const sigstore_1 = __nccwpck_require__(9149);
const validate_1 = __nccwpck_require__(1997);
const predicate1_1 = __nccwpck_require__(2338);
const predicate02_1 = __nccwpck_require__(4816);
Expand Down Expand Up @@ -125,7 +125,7 @@ function run() {
const bundle = JSON.parse(bundleStr);
// First, verify the signature, i.e., that it is signed by a certificate that
// chains up to Fulcio.
yield sigstore.verify(bundle, Buffer.from(b64Token));
yield (0, sigstore_1.verify)(bundle, Buffer.from(b64Token));
const rawToken = Buffer.from(b64Token, "base64");
core.debug(`bundle: ${bundleStr}`);
core.debug(`token: ${rawToken}`);
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/verify-token/dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/actions/verify-token/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ limitations under the License.
*/

import * as core from "@actions/core";
import * as sigstore from "sigstore";
import { verify } from "sigstore";
import {
validateField,
validateFieldAnyOf,
Expand Down Expand Up @@ -97,7 +97,7 @@ async function run(): Promise<void> {

// First, verify the signature, i.e., that it is signed by a certificate that
// chains up to Fulcio.
await sigstore.verify(bundle, Buffer.from(b64Token));
await verify(bundle, Buffer.from(b64Token));

const rawToken = Buffer.from(b64Token, "base64");
core.debug(`bundle: ${bundleStr}`);
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/verify-token/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import { rawTokenInterface } from "./types";
import * as core from "@actions/core";
import * as sigstore from "sigstore";
import { Bundle } from "sigstore";
import * as child_process from "child_process";
import * as tscommon from "tscommon";
import * as github from "@actions/github";
Expand Down Expand Up @@ -119,7 +119,7 @@ export function asMap<T>(inputs: Map<string, T>): Map<string, T> {
}

export function parseCertificate(
bundle: sigstore.Bundle,
bundle: Bundle,
): [string, string, string, string, string] {
if (bundle === undefined) {
throw new Error(`undefined bundle.`);
Expand Down
4 changes: 2 additions & 2 deletions actions/delegator/setup-generic/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const github = __importStar(__nccwpck_require__(5438));
const core = __importStar(__nccwpck_require__(2186));
const process = __importStar(__nccwpck_require__(7282));
const sigstore = __importStar(__nccwpck_require__(9149));
const sigstore_1 = __nccwpck_require__(9149);
const tscommon = __importStar(__nccwpck_require__(6634));
function run() {
return __awaiter(this, void 0, void 0, function* () {
Expand Down Expand Up @@ -159,7 +159,7 @@ function run() {
core.info(`unsignedToken: ${unsignedToken}`);
core.info(`unsignedB64Token: ${unsignedB64Token}`);
// Sign and prepare the base64 bundle.
const bundle = yield sigstore.sign(Buffer.from(unsignedB64Token));
const bundle = yield (0, sigstore_1.sign)(Buffer.from(unsignedB64Token));
// Verify just to double check.
// NOTE: this is an offline verification.
// TODO(#1668): re-enable verification.
Expand Down
2 changes: 1 addition & 1 deletion actions/delegator/setup-generic/dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions actions/delegator/setup-generic/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.
import * as github from "@actions/github";
import * as core from "@actions/core";
import * as process from "process";
import * as sigstore from "sigstore";
import { sign } from "sigstore";
import * as tscommon from "tscommon";

async function run(): Promise<void> {
Expand Down Expand Up @@ -128,7 +128,7 @@ async function run(): Promise<void> {
core.info(`unsignedB64Token: ${unsignedB64Token}`);

// Sign and prepare the base64 bundle.
const bundle = await sigstore.sign(Buffer.from(unsignedB64Token));
const bundle = await sign(Buffer.from(unsignedB64Token));

// Verify just to double check.
// NOTE: this is an offline verification.
Expand Down

0 comments on commit f52ab2f

Please sign in to comment.