Skip to content

[BUG] apigateway: CreateApiKey drops "tags" and GetApiKey is not implemented (404) #1676

Description

@awuzi

Service

API Gateway (REST)

AWS API Action

CreateApiKey, GetApiKey, GetApiKeys

Expected behavior

  • CreateApiKey persists the tags passed in the request, and they are returned by CreateApiKey, GetApiKey and GetApiKeys.
  • GetApiKey (GET /apikeys/{apiKeyId}) returns the API key as JSON, or a JSON NotFoundException when it doesn't exist.

Actual behavior

  • CreateApiKey silently drops tags: they are not stored and never appear in any response.
  • GetApiKey is not routed --> HTTP 404 with an XML body, so the AWS SDK v3 (REST-JSON) fails to parse it: SyntaxError: Unexpected token '<', "<?xml vers"... is not valid JSON.
  • GetApiKeys returns items with only id, name, value, enabled. No tags.

Reproduction

AWS CLI:

EP="--endpoint-url http://localhost:4566 --region us-east-1"

# 1) Create a key with tags
aws $EP apigateway create-api-key --name k --enabled --tags Team=platform,Project=demo
# -> response contains id/name/value/enabled but NO "tags"

# 2) Read it back by id (use the id returned above)
aws $EP apigateway get-api-key --api-key <API_KEY_ID>
# -> HTTP 404 with an XML body (expected: the key, including its tags)

# 3) List keys
aws $EP apigateway get-api-keys
# -> items contain no "tags"

TypeScript (@aws-sdk/client-api-gateway v3):

import {
  APIGatewayClient, CreateApiKeyCommand, GetApiKeyCommand, GetApiKeysCommand
} from '@aws-sdk/client-api-gateway';

const client = new APIGatewayClient({
  endpoint: 'http://localhost:4566',
  region: 'us-east-1',
  credentials: { accessKeyId: 'test', secretAccessKey: 'test' }
});

// 1) Create a key with tags
const created = await client.send(new CreateApiKeyCommand({
  name: 'k', enabled: true, tags: { Team: 'platform', Project: 'demo' }
}));
console.log(created.tags); // undefined,  expected { Team: 'platform', Project: 'demo' }

// 2) Read it back by id
await client.send(new GetApiKeyCommand({ apiKey: created.id!, includeValue: false }));
// throws: HTTP 404 + "<?xml ...>" body → SyntaxError: Unexpected token '<'

// 3) List keys
const list = await client.send(new GetApiKeysCommand({}));
console.log(list.items?.[0]); // { id, name, value, enabled } , no tags

Environment

  • Floci version / image tag: floci/floci:1.5.28
  • How you're running Floci: Docker (docker compose, image floci/floci:latest)

Metadata

Metadata

Assignees

Labels

apigatewayAmazon API Gateway (REST/v1)bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions