AuthSchemeCard
Domain · API DocSelectable card describing a single auth scheme (apiKey, http, oauth2, openIdConnect, mutualTLS).
<%- include('modules/domain/api-doc/AuthSchemeCard', {
name: 'OAuth 2.0',
type: 'oauth2',
recommended: true,
description: 'Authorization Code flow with PKCE — preferred for user-facing apps.',
metaItems: [
{ label: 'Client ID', value: 'prod_client_42' },
{ label: 'Scopes', value: 'read write' },
],
href: '/auth/oauth2'
}) %>
X-API-Key
apiKey
Static header-based key for server-to-server integrations.
<%- include('modules/domain/api-doc/AuthSchemeCard', {
name: 'X-API-Key',
type: 'apiKey',
description: 'Static header-based key for server-to-server integrations.'
}) %>
<%
var _name = locals.name || '';
var _type = locals.type || 'apiKey';
var _description = locals.description || null;
var _recommended = !!locals.recommended;
var _metaItems = locals.metaItems || null;
var _href = locals.href || null;
var _onSelect = !!locals.onSelect;
var _className = locals.className || '';
var schemeIcon = {
apiKey: 'fa-solid fa-key',
http: 'fa-solid fa-lock',
oauth2: 'fa-solid fa-shield',
openIdConnect: 'fa-solid fa-fingerprint',
mutualTLS: 'fa-solid fa-user-shield',
};
var iconClass = schemeIcon[_type] || schemeIcon.apiKey;
var interactive = !!(_href || _onSelect);
var baseClass = 'block rounded-xl border border-border bg-surface-raised p-4 text-left'
+ (interactive ? ' transition-shadow hover:shadow-md hover:border-border-focus focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus' : '')
+ (_className ? ' ' + _className : '');
%>
<% if (_href) { %>
<% } else if (_onSelect) { %>