diff --git a/src/components/Bucket.tsx b/src/components/Bucket.tsx index 2169ef5..bc985ad 100644 --- a/src/components/Bucket.tsx +++ b/src/components/Bucket.tsx @@ -93,7 +93,12 @@ const Bucket = ({ {isPermPresent && ( - + + {info.origin && ( +

+ Origin: {info.origin} +

+ )}
{Object.entries(info.permissions).map(([key, value]) => (
diff --git a/src/lib/recorder.ts b/src/lib/recorder.ts index 6c48509..e1155c7 100644 --- a/src/lib/recorder.ts +++ b/src/lib/recorder.ts @@ -17,9 +17,6 @@ const getPerms = ($: cheerio.CheerioAPI, hostname: string) => { const hasListBucket = $("ListBucketResult"); let type = ""; const date = new Date().getTime(); - console.log("Date", date); - console.log("Hostname", hostname); - try { if (!hasUri.length && !hasCode.length && hasListBucket) throw new Error("No permissions"); @@ -99,7 +96,10 @@ export const recordBuckets = async ( storage.set({ buckets: { ...buckets, - [bucketInfo.type]: [bucketInfo.info, ...buckets[bucketInfo.type]], + [bucketInfo.type]: [ + { ...bucketInfo.info, origin: response.initiator }, + ...buckets[bucketInfo.type], + ], }, }); if (bucketInfo.type === "good") addNumber(buckets); diff --git a/src/types/index.ts b/src/types/index.ts index 1f56e99..700ba05 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -4,6 +4,7 @@ export interface IBucketInfo { permissions: Record; date: number; hostname: string; + origin: string; } export type ILastSeen = Record;