// Provider-side API adapter. No widget policy, DOM or MQFT logic. export async function verifyWithTekasus(claims, config, {fetchImpl = fetch} = {}) { if (!config || typeof config.credential !== 'string' || !/^[a-f0-9]{64}$/.test(config.credential) || typeof config.url !== 'string' || new URL(config.url).protocol !== 'https:') { throw new Error('verification_unavailable'); } const response = await fetchImpl(config.url, { method:'POST', redirect:'error', signal:AbortSignal.timeout(8000), headers:{'Content-Type':'application/json',Authorization:`Bearer ${config.credential}`}, body:JSON.stringify(claims) }); if (!response.ok) throw new Error('verification_unavailable'); const result = await response.json(); if (!['ok','refused'].includes(result?.status)) throw new Error('invalid_response'); return {status:result.status}; }