twilio

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package twilio provides a verifier for Twilio API keys. It uses the Twilio Accounts API GET /2010-04-01/Accounts.json endpoint with Basic auth to check key validity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

Verifier checks whether a Twilio API key is active by calling the Twilio Accounts API. It NEVER logs or persists raw key values.

func (*Verifier) Type

func (v *Verifier) Type() string

Type returns the detector ID this verifier handles.

func (*Verifier) Verify

Verify checks if the detected Twilio API key is valid/active.

The detector emits the API Key SID ("SK...") as raw.Raw and the Account SID ("AC...") as raw.ExtraData["account_sid"]. Twilio's REST API accepts exactly two Basic-Auth pairs: (Account SID, Auth Token) or (API Key SID, API Key Secret). Since raw.Raw is an API Key SID, the only valid pairing is (API Key SID, API Key Secret): the SID is the Basic-Auth username and the paired API Key Secret is the password. The API Key SID alone is a non-secret identifier and cannot authenticate on its own, so when the paired secret is not available (raw.ExtraData["api_key_secret"] is empty) the key is reported as Unverified — never as inactive, which would misread a live but unpaired credential as revoked.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL