Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
28 lines
1001 B
TypeScript
28 lines
1001 B
TypeScript
import {
|
|
OFFICIAL_MARKETPLACE_OWNER,
|
|
isOfficialMarketplaceGitSource,
|
|
isOfficialOrganizationGitSource,
|
|
isReservedPluginIdentity
|
|
} from '../../shared/plugins/plugin-marketplace'
|
|
import type { PluginMarketplaceFetchResult } from './plugin-marketplace-fetch'
|
|
import type { PluginMarketplaceRegisteredSource } from './plugin-marketplace-store'
|
|
|
|
export function validateMarketplaceProvenance(
|
|
source: PluginMarketplaceRegisteredSource,
|
|
fetched: PluginMarketplaceFetchResult
|
|
): void {
|
|
if (
|
|
isOfficialMarketplaceGitSource(source.source.url) &&
|
|
fetched.marketplace.owner.toLowerCase() !== OFFICIAL_MARKETPLACE_OWNER
|
|
) {
|
|
throw new Error('official marketplace metadata has an unexpected owner')
|
|
}
|
|
for (const entry of fetched.marketplace.plugins) {
|
|
if (isReservedPluginIdentity(entry.id) && !isOfficialOrganizationGitSource(entry.source.url)) {
|
|
throw new Error(
|
|
`reserved plugin identity ${entry.id} must resolve to the stablyai organization`
|
|
)
|
|
}
|
|
}
|
|
}
|