Skip to content

SSO Admin is unreachable: parser.go maps a guessed X-Amz-Target prefix, not the real SWBExternalService #561

Closed

Description

@scttfrdmn

Summary

SSOPlugin is registered and has a test file, but no SDK or CLI can reach it.
emulator/parser.go's targetServiceAliases maps a target prefix that no client
actually sends:

// "AWSSSOAdminService" → strip "AWS" → "ssoadminservice" → "sso".
// aws-sdk-go-v2 SSO Admin client uses X-Amz-Target: AWSSSOAdminService.{Op}.
"awsssoadminservice": "sso",

The real target prefix in the sso-admin service model is SWBExternalService,
so every request falls through to the "service not emulated" path:

$ aws sso-admin list-instances
An error occurred (ServiceNotAvailable) … service not emulated: swbexternalservice

Confirmed over the wire with an explicit header, which produces the same error:

$ curl -s -X POST localhost:4620/ \
    -H 'Authorization: AWS4-HMAC-SHA256 Credential=…/us-east-1/sso/aws4_request' \
    -H 'X-Amz-Target: SWBExternalService.ListInstances' \
    -H 'Content-Type: application/x-amz-json-1.1' -d '{}'

Why it was never caught

sso_plugin_test.go calls p.HandleRequest directly, so it exercises the
plugin in-process and never goes through extractService. That is the same shape as
the API Gateway v2 routing gap recorded on #529: a registered, tested plugin that
the router cannot reach. Every unit test is green and the feature does not exist
from a caller's point of view.

Provenance

The SWBExternalService prefix comes from the sso-admin botocore service model's
metadata.targetPrefix, and from observing the CLI's actual request. The comment
in parser.go states the derivation it was guessed from with some confidence, so
the correction should be recorded there rather than silently replacing the line.

Fix

Add "swbexternalservice": "sso" to targetServiceAliases, alongside the
existing guessed key rather than replacing it — keeping it costs nothing and any
client that does send the guessed prefix keeps working — and correct the comment.

Not affected: casing

Unlike #529's plugins, SSO Admin's wire casing is already right. sso-admin is the
json protocol and ListInstances.Instances has no locationName rename, so its
effective wire key is Instances — PascalCase, which is what the plugin emits.
This is a routing fix only.

Acceptance criteria

  • aws sso-admin list-instances reaches SSOPlugin and returns a parseable
    response against a live substrate server.
  • A table-driven case in parser_test.go asserts that
    X-Amz-Target: SWBExternalService.ListInstances resolves to sso, so the
    routing is covered without a live server.
  • The existing awsssoadminservice alias still resolves to sso.
  • The parser.go comment records that SWBExternalService is the real prefix
    and that the old key is kept for compatibility, so the wrong derivation is not
    re-copied.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions