Skip to content

Authorization denials on pricing report the XML AccessDenied, and no test can see an unmapped plugin #653

Closed

Description

@scttfrdmn

accessDeniedCodeFor derives an error code from serviceErrorProtocols
(emulator/error_protocol.go), and AuthController.CheckAccess calls it as
accessDeniedCodeFor(req.Service, "") — with no Content-Type. So a service absent
from that map does not fall through to the Content-Type sniff in any useful way: it
takes errorProtocolFor's final errProtoQueryXML default and the caller is refused
with the bare XML code AccessDenied.

pricing is absent from the map. The Price List API is protocol: json,
jsonVersion 1.1, targetPrefix AWSPriceListService (vendored botocore
pricing/2017-10-15/service-2.json.gz), and its model declares an
AccessDeniedException shape outright
— so the correct code is unambiguous here, not
inferred from the protocol split #595 documents.

Two consequences:

  1. An IAM-gated pricing:GetProducts denial from AuthController reports
    AccessDenied, which the SDK's Price List error parser cannot match — the STS: identity-policy denials report AccessDeniedException where AWS sends AccessDenied #595
    failure mode, in the opposite direction.
  2. Substrate reports two codes for one outcome on one service: the plugin's own
    pricingErrAccessDenied = "AccessDeniedException" (pricing_plugin.go:46, correct)
    versus the generic gate's AccessDenied. That is STS: identity-policy denials report AccessDeniedException where AWS sends AccessDenied #595's exact complaint restated,
    and TestAccessDenied_IAMPluginAgreesWithTheGenericGate exists because the same
    drift was found for IAM.

pricing is the only remaining unmapped plugin: diffing every Plugin.Name() value
against serviceErrorProtocols yields 67 registered names, of which config (fixed in
the v0.101.0 work) and pricing were missing.

Acceptance criteria

  • "pricing": errProtoJSONRPC added to serviceErrorProtocols, with the model's
    own AccessDeniedException shape cited as the evidence.
  • A test asserts the plugin's pricingErrAccessDenied equals what
    accessDeniedCodeFor("pricing", "") derives, mirroring
    TestAccessDenied_IAMPluginAgreesWithTheGenericGate — the drift, not just the
    value.
  • A property test asserts every registered Plugin.Name() appears in
    serviceErrorProtocols, so the next plugin cannot land unmapped. The existing
    TestAccessDenied_MatchesTheServiceErrorProtocol iterates the map, so a service
    missing from it is invisible to that test — which is why both gaps survived.
  • CHANGELOG Fixed entry.

Activity

  1. added this to the v0.103.0 milestone on Aug 20, 2026
  2. scttfrdmn commented on Aug 20, 2026

    @scttfrdmn
    OwnerAuthor

    Fixed in #667, shipping in v0.103.0. pricing is now classified as JSON RPC in
    serviceErrorProtocols, so the generic authorization gate derives AccessDeniedException
    for it and the two spellings substrate had for one outcome on one service become one.

    One detail your analysis did not have, and it slightly changes where the authority for the
    fix comes from. The Price List model does declare an AccessDeniedException shape
    ("exception": true, "General authentication failure."), but only on GetPriceListFileUrl
    and ListPriceLists — not on GetProducts, the operation you reported. So for
    GetProducts neither spelling is modeled, and the protocol rule alone decides it: the
    model's "protocol": "json" with jsonVersion 1.1 and targetPrefix AWSPriceListService.
    The shape corroborates the spelling rather than supplying it, which is worth knowing if
    this ever needs revisiting.

    The second half of the fix is why this survived in the first place. The property test
    guarding the mapping iterated serviceErrorProtocols itself, so a service missing from
    the map had no entry to iterate and was invisible to it — config sat in the same blind
    spot until #580, and pricing would have sat there indefinitely. The assertion is now
    driven from the plugin registry: every plugin RegisterDefaultPlugins registers must have
    an entry, and a new plugin that lands without one fails with a message naming it and saying
    what to add. That is the part that makes this the last time rather than the second time.

    Compatibility note for anyone with a fixture on the old string: a pricing authorization
    denial changes code from AccessDenied to AccessDeniedException. It was never a code the
    Price List SDK could parse, which is the bug you reported.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions