Commits on Source 2

  • Matt Cockayne's avatar
    feat: build a provider on a Gitea client you already have · c0a3254b
    Matt Cockayne authored
    Spec 0008 D5, rung 1 of the ladder in D10. NewProviderFromClient takes a
    *giteasdk.Client the caller already holds and builds a provider on it. Both
    registrations — Gitea and Codeberg — reach it.
    
    The rung TRANSFERS THE CREDENTIAL OBLIGATION, exactly as WithHTTPClient (D4)
    transfers the redirect-policy obligation. Settings.Credential must be nil, and
    supplying one is ErrCredentialWithClient rather than a silent preference.
    
    ENDPOINT.HOST IS REQUIRED HERE, which is an asymmetry with the other two SDK
    adapters and worth stating plainly. go-github and go-gitlab both expose an
    accessor for the instance they address, so those adapters read it back off the
    injected client. gitea.dev/sdk keeps its url field unexported and offers no
    accessor — checked at v1.2.0, where every exported method on Client is a typed
    API call or a setter. The host is what the Sites capability derives a published
    site's domain from, so an absent one is ErrHostRequiredWithClient rather than a
    default that would point at the wrong instance.
    
    ASSET DOWNLOADS ARE ANONYMOUS AT THIS RUNG. A Gitea asset is fetched from
    browser_download_url, which is not an API call: the SDK never makes it and offers
    no method that would — GetReleaseAttachment returns metadata, not bytes. This
    provider fetches it directly and would normally attach its own Authorization
    header, gated by forge.HostTrusted; it has no credential to attach here and the
    SDK exposes no way to read one back.
    
    A public asset downloads and a private one does not. A caller who needs
    authenticated downloads uses a lower rung, where this module still owns the
    credential.
    
    Every guard is falsified against the mutant that removes it, including inventing
    a token, which fails TestFromClientDownloadsAnonymously.
    c0a3254b
  • Matt Cockayne's avatar
    chore(main): release v0.13.0 · 5448e7fc
    Matt Cockayne authored
    5448e7fc
Loading
Loading