GROWI's API authentication accepts an access token only as a Bearer token in the
Authorization header or as an access_token query/body parameter. When the
Authorization header is already consumed (for example, Basic authentication on a
reverse proxy), callers must fall back to the query parameter, which leaks the token into
URLs, server logs, browser history, and referrers.
This feature adds a dedicated request header, X-GROWI-ACCESS-TOKEN, as an additional
token source for the Access Token Parser, covering both the scope-based access-token path
and the legacy api-token path, and advertises it in the OpenAPI definitions. It also
establishes this spec as the cc-sdd maintenance baseline for the Access Token Parser
middleware. The salvage source is upstream PR #10443.
X-GROWI-ACCESS-TOKEN request header for both
the scope-based access-token path and the legacy api-token path.accessTokenHeaderAuth security scheme in the apiv1 and apiv3 OpenAPI
definitions and applying it to the routes that already advertise the Bearer and
query token methods.Objective: As an API caller whose Authorization header is already in use, I want to
supply my scoped access token in the X-GROWI-ACCESS-TOKEN header, so that I can
authenticate without exposing the token in the URL.
X-GROWI-ACCESS-TOKEN
header and no Bearer token is present, the Access Token Parser shall authenticate the
request as the token's owner.X-GROWI-ACCESS-TOKEN header grants a scope that
satisfies the route's required scope, the Access Token Parser shall attach the
authenticated user to the request.X-GROWI-ACCESS-TOKEN header name
case-insensitively, accepting it regardless of the letter casing used by the client.Objective: As an API caller using a legacy api-token on a route that still accepts it,
I want to supply that token in the X-GROWI-ACCESS-TOKEN header, so that I get the same
header-based option as scoped tokens.
X-GROWI-ACCESS-TOKEN header and no Bearer token is present,
the Access Token Parser shall authenticate the request as the token's owner.X-GROWI-ACCESS-TOKEN header.Objective: As an API caller, I want predictable precedence among the token sources, so that adding the header does not change the behavior of requests that already work.
Authorization header and a token in
the X-GROWI-ACCESS-TOKEN header, the Access Token Parser shall use the Bearer token.X-GROWI-ACCESS-TOKEN header and also in the
access_token query or body parameter, and no Bearer token is present, the Access
Token Parser shall use the X-GROWI-ACCESS-TOKEN header value.X-GROWI-ACCESS-TOKEN header, the Access Token Parser shall
continue to resolve the token from the Bearer, query, and body sources exactly as
before this feature.X-GROWI-ACCESS-TOKEN header is present but is not a single string value, the
Access Token Parser shall ignore it and fall back to the remaining token sources.Objective: As a security-conscious operator, I want header-supplied tokens to be held to the same validation as other sources, so that the new header cannot bypass any check.
X-GROWI-ACCESS-TOKEN header is invalid, expired, or
unknown, the Access Token Parser shall leave the request unauthenticated and allow
downstream authorization to reject it.X-GROWI-ACCESS-TOKEN header lacks a scope
sufficient for the route, the Access Token Parser shall leave the request
unauthenticated.X-GROWI-ACCESS-TOKEN header belongs to a
read-only user on a path that rejects read-only users, the Access Token Parser shall
leave the request unauthenticated.Objective: As an API consumer reading the OpenAPI specification, I want the header
authentication method to be documented, so that I know X-GROWI-ACCESS-TOKEN is a
supported way to authenticate.
accessTokenHeaderAuth
security scheme that authenticates via the x-growi-access-token request header.accessTokenHeaderAuth method for that route.bearer and accessTokenInQuery
security methods alongside the new accessTokenHeaderAuth method.