Skip to content

Authentication

Public Endpoints

Most Vulnpatch API endpoints are publicly accessible and don't require authentication:

EndpointAuth Required
GET /api/v1/statsNo
GET /api/v1/issuesNo
GET /api/v1/repology/:packageNo
GET /api/v1/osv/:packageNo
GET /api/v1/vulns/:packageNo
GET /api/v1/osv-details/:idNo

Authenticated Endpoints

Some endpoints require authentication via GitHub OAuth:

EndpointAuth Required
POST /api/v1/request-accessGitHub OAuth

GitHub OAuth Flow

Vulnpatch uses GitHub's Device Flow for authentication:

  1. Initiate Flow: Call the GitHub device authorization endpoint
  2. User Verification: User visits GitHub and enters the provided code
  3. Token Exchange: Exchange the device code for an access token
  4. API Calls: Include the token in authenticated requests

Example: Request Access

javascript
// After obtaining a GitHub token via device flow
const response = await fetch('https://api.vulnpatch.dev/api/v1/request-access', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    token: 'gho_xxxxxxxxxxxx',
  }),
});

Security Best Practices

  • Never expose your GitHub tokens in client-side code
  • Use environment variables for token storage
  • Rotate tokens regularly
  • Only request the minimum required OAuth scopes

Helping secure open source