모든 사용자에게 글로벌 키로 잘못된 액세스 발생

오늘 이 문제를 발견했습니다.

모든 사용자에 대해 글로벌 스코프를 가진 API 키를 생성한 후, 주제를 업데이트하면 invalid_access 오류가 발생합니다.

curl --location --request PUT 'https://example.com/t/-/365.json' \
--header 'Api-User: system' \
--header 'Api-Key: ***' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tags": ["awesome-tag"]
}'
{
    "errors": [
        "You are not permitted to view the requested resource. The API username or key is invalid."
    ],
    "error_type": "invalid_access"
}

그러나 system 사용자에게 글로벌 API 키를 생성하면 정상적으로 작동합니다: 동일한 요청, 다른 키.

curl --location --request PUT 'https://example.com/t/-/365.json' \
--header 'Api-User: system' \
--header 'Api-Key: DIFFERENT_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tags": ["awesome-tag"]
}'
{
    "basic_topic": {
        "id": 365,
        "title": "Test topic",
        "fancy_title": "Test topic",
        "slug": "test-topic",
        "posts_count": 6
    }
}

이것은 Api-User가 아니라 Api-Username이어야 합니다.

이 헤더는 “all user” API 키에서만 사용되므로, 키를 특정 사용자로 범위를 지정했을 때 작동했던 것입니다.

아, 알겠습니다. 최근에 변경된 건가요? 헤더가 Api-User인 줄 알았거든요.