Skip to main content
This document covers the implementation details for AI•Pkg.Server that are specific to how we build the registry — not the public API contract (see Registry API spec).

Authentication

Used for web UI login. Scope: read:user, user:email.Port the existing GitHub OAuth flow from NuGetGallery. No structural changes.

Storage

Azure Blob Storage containers:
ContainerContents
aipkg-packages.aipkg archive files
aipkg-manifestsExtracted .aispec files (for fast manifest reads)
aipkg-registrationRegistration JSON blobs (registration pages)
aipkg-iconsExtracted and resized package icons
aipkg-readmesExtracted README files
Port ICoreFileStorageService from NuGetGallery. Rename all .nupkg references to .aipkg.

Search Index

Azure AI Search index: aipkg-packages Port the indexing pipeline from NuGet.Services.AzureSearch. Replace BaseMetadataDocument with AipkgSearchDocument:
FieldTypeSearchableFilterableSortable
idstringyesyesyes
versionstringnonono
titlestringyesnono
descriptionstringyesnono
authorsstring[]yesyesno
tagsstring[]yesyesno
capabilitiesstring[]noyesno
targetsstring[]noyesno
permissionsstring[]noyesno
totalDownloadsint64nonoyes
lastPublishedDateTimeOffsetnoyesyes
listedboolnoyesno
verifiedboolnoyesno

Background Jobs

JobSourceAdaptation
CDN stats parsingsrc/Stats.*Parse .aipkg download events
GitHub vulnerabilitysrc/GitHubVulnerabilities2Db/Adapt package ID resolution
Search index syncNuGet.Services.AzureSearchNew document model
Registration blob builderCatalog2RegistrationUpdated JSON-LD schema
License scanningValidation jobsEvaluate; lower priority
All background jobs are consolidated into AI•Pkg.Jobs/ (a single project). Each job is implemented as a hosted service or Azure Function, depending on runtime requirements.

NuGet V3 → AI•Pkg Registry API Endpoint Mapping

This table documents the mapping from NuGetGallery’s V3 endpoints to AI•Pkg’s registry endpoints. Use it when porting endpoint logic from NuGetGallery/Controllers/ApiController.cs and related sources.
NuGet V3 Source EndpointAI•Pkg Registry EndpointDelta
GET /v3/index.jsonGET /v3/index.jsonUpdated @type values for new resource types
GET /v3/registration/{id}/index.jsonGET /v3/registration/{id}/index.jsonNew fields: capabilities, targets, permissions; remove requireLicenseAcceptance, semVerLevel
GET /v3/registration/{id}/{lower}.jsonGET /v3/registration/{id}/{lower}.jsonSame shape; AI•Pkg fields substituted
GET /v3/flatcontainer/{id}/index.jsonGET /v3/flatcontainer/{id}/index.jsonNo change
GET /v3/flatcontainer/{id}/{v}/{id}.{v}.nupkgGET /v3/flatcontainer/{id}/{v}/{id}.{v}.aipkgExtension: .nupkg.aipkg; MIME: application/x-aipkg
(none)GET /v3/flatcontainer/{id}/{v}/{id}.{v}.aispecNew: manifest-only endpoint; no archive download needed
GET /v3/searchGET /v3/searchNew query params: apm, capability, permission; response fields renamed
GET /v3/autocompleteGET /v3/autocompleteNo change
PUT /v3/packagePUT /v3/package.aipkg payload; new validation rules
DELETE /v3/package/{id}/{version}DELETE /v3/package/{id}/{version}Same behavior (unlist, not physical delete)
(none)GET /v3/platformsNew: canonical APM platform list
(none)GET /v3/registration/{id}/{v}/install/{apm}New: per-APM resolved install manifest

Source Files to Port

Key NuGetGallery source files and their AI•Pkg destinations:
NuGetGallery sourceAI•Pkg destinationAction
src/NuGetGallery/Controllers/ApiController.cs (V3 parts)AI•Pkg.Server/Api/V3/Port push/delete/autocomplete as Minimal APIs
src/NuGet.Jobs.Catalog2Registration/Schema/EntityBuilder.csAI•Pkg.Server/Jobs/RegistrationBuilder.csPort; update JSON-LD schema
src/NuGetGallery/Services/PackageService.csAI•Pkg.Server/Services/PackageService.csPort; strip symbol/V2 logic
src/NuGetGallery/Services/UserService.csAI•Pkg.Server/Services/UserService.csPort PBKDF2 API key management
src/NuGetGallery/Authentication/AI•Pkg.Server/Auth/Port GitHub OAuth + API key auth
src/NuGetGallery.Core/Services/CorePackageFileService.csAI•Pkg.Server/Storage/PackageStorageService.csPort; rename .nupkg.aipkg
src/NuGet.Services.AzureSearch/Models/BaseMetadataDocument.csAI•Pkg.Server.Search/AipkgSearchDocument.csPort structure; adapt fields
src/Stats.*src/AI•Pkg.Jobs/Stats/Port CDN stats parsing; adapt for .aipkg
src/GitHubVulnerabilities2Db/src/AI•Pkg.Jobs/Vulnerabilities/Port; adapt package ID resolution