Skip to content

Module foundation — Auth, Client, and Games (v1.0) #5

Description

Parent: #4

The module needs a working foundation before any endpoint-specific functionality can be built. This PBI delivers the scaffolding, authentication via the Context module, the central REST client, and the Games endpoints as proof of pattern.

This PBI represents the v1.0.0 release — the minimum viable module that proves the architecture works end-to-end.

Acceptance criteria:

  • Repository layout follows PSModule Standards
  • Connect-CurseForge stores API key in a named vault via the Context module
  • Disconnect-CurseForge removes stored credentials
  • Get-CurseForgeContext retrieves the active context
  • Invoke-CurseForgeAPI sends authenticated requests and handles pagination
  • Get-CurseForgeGame works end-to-end (list and single)
  • Get-CurseForgeGameVersion retrieves versions for a game
  • Get-CurseForgeGameVersionType retrieves version types
  • CurseForgeContext class models the stored auth state
  • CurseForgeGame, CurseForgeGameAssets, CurseForgeGameVersionType classes model domain objects
  • Format files provide default table views for game objects
  • Unit tests cover auth flow, pagination logic, and game endpoint parsing

Two authentication modes stored in a single context:

Mode Header Source
Core API x-api-key Studios Console key
Upload API X-Api-Token Author token page

Both stored as properties on one CurseForgeContext object per identity in vault PSModule.CurseForge.

Context pattern (following GitHub module):

  • $script:CurseForge module-scope variable holds config (ContextVault, ApiBaseUri, defaults)
  • Connect-CurseForge accepts -ApiKey (Core) and optionally -AuthorToken (Upload), persists via Set-Context
  • Resolve-CurseForgeContext (private) retrieves and validates before each API call
  • All private functions receive a mandatory [CurseForgeContext] $Context parameter

Base URLs:

  • Core API: https://api.curseforge.com with /v1/ (or /v2/) path prefix
  • Upload API: https://{game}.curseforge.com/api/ (deferred to PBI 7)

Pagination: Max page size 50, max total 10,000. Invoke-CurseForgeAPI auto-paginates by default.


Sub-issues

See linked Tasks below.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions