Skip to content

Commit

Permalink
fix: remove ubiquibot phrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Jul 30, 2024
1 parent 1f6c922 commit b22d978
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/github/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { expressionRegex } from "../types/plugin";
import { configSchema, configSchemaValidator, PluginConfiguration } from "../types/plugin-configuration";
import { getManifest } from "./plugins";

const UBIQUIBOT_CONFIG_FULL_PATH = ".github/.ubiquibot-config.yml";
const UBIQUIBOT_CONFIG_ORG_REPO = "ubiquibot-config";
const CONFIG_FULL_PATH = ".github/.ubiquibot-config.yml";
const CONFIG_ORG_REPO = "ubiquibot-config";

async function getConfigurationFromRepo(context: GitHubContext, repository: string, owner: string) {
const targetRepoConfiguration: PluginConfiguration = parseYaml(
Expand Down Expand Up @@ -60,7 +60,7 @@ export async function getConfig(context: GitHubContext): Promise<PluginConfigura
let mergedConfiguration: PluginConfiguration = defaultConfiguration;

const configurations = await Promise.all([
getConfigurationFromRepo(context, UBIQUIBOT_CONFIG_ORG_REPO, payload.repository.owner.login),
getConfigurationFromRepo(context, CONFIG_ORG_REPO, payload.repository.owner.login),
getConfigurationFromRepo(context, payload.repository.name, payload.repository.owner.login),
]);

Expand Down Expand Up @@ -143,7 +143,7 @@ async function download({ context, repository, owner }: { context: GitHubContext
const { data } = await context.octokit.rest.repos.getContent({
owner,
repo: repository,
path: UBIQUIBOT_CONFIG_FULL_PATH,
path: CONFIG_FULL_PATH,
mediaType: { format: "raw" },
});
return data as unknown as string; // this will be a string if media format is raw
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const UBIQUIBOT_KERNEL_PUBLIC_KEY = "";
export const KERNEL_PUBLIC_KEY = "";
6 changes: 3 additions & 3 deletions src/sdk/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { Context } from "./context";
import { customOctokit } from "./octokit";
import { EmitterWebhookEventName as WebhookEventName } from "@octokit/webhooks";
import { verifySignature } from "./signature";
import { UBIQUIBOT_KERNEL_PUBLIC_KEY } from "./constants";
import { KERNEL_PUBLIC_KEY } from "./constants";
import { Logs, LogLevel, LOG_LEVEL } from "@ubiquity-dao/ubiquibot-logger";
import { Manifest } from "../types/manifest";

interface Options {
ubiquibotKernelPublicKey?: string;
kernelPublicKey?: string;
logLevel?: LogLevel;
}

Expand All @@ -32,7 +32,7 @@ export async function createPlugin<TConfig = unknown, TEnv = unknown, TSupported
const payload = await ctx.req.json();
const signature = payload.signature;
delete payload.signature;
if (!(await verifySignature(options?.ubiquibotKernelPublicKey || UBIQUIBOT_KERNEL_PUBLIC_KEY, payload, signature))) {
if (!(await verifySignature(options?.kernelPublicKey || KERNEL_PUBLIC_KEY, payload, signature))) {
throw new HTTPException(400, { message: "Invalid signature" });
}

Expand Down
2 changes: 1 addition & 1 deletion tests/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ beforeAll(async () => {
};
},
{ name: "test" },
{ ubiquibotKernelPublicKey: publicKey }
{ kernelPublicKey: publicKey }
);
server.listen();
});
Expand Down

0 comments on commit b22d978

Please sign in to comment.