Auth
Auth
Authentication configuration types.
Quarto Wizard supports GitHub authentication via environment variables. This is useful for accessing private repositories or increasing API rate limits.
Envvar
GITHUB_TOKEN - GitHub personal access token for API authentication.
Envvar
QUARTO_WIZARD_TOKEN - Alternative token variable (fallback if GITHUB_TOKEN is not set).
GITHUB_TOKEN takes precedence over QUARTO_WIZARD_TOKEN if both are set.
Examples
Terminal
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTerminal
export QUARTO_WIZARD_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxNote
Tokens can also be set via VS Code settings or the extension’s authentication UI.
Interfaces
AuthConfig
Defined in: packages/core/src/types/auth.ts:41
Authentication configuration for API requests.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
githubToken? |
string |
GitHub personal access token for GitHub API and private repos. | packages/core/src/types/auth.ts:43 |
httpHeaders |
HttpHeader[] |
Custom HTTP headers for URL downloads. | packages/core/src/types/auth.ts:45 |
AuthConfigOptions
Defined in: packages/core/src/types/auth.ts:51
Options for creating an AuthConfig.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
githubToken? |
string |
GitHub personal access token. | packages/core/src/types/auth.ts:53 |
httpHeaders? |
string[] |
HTTP headers in “Name: Value” format. | packages/core/src/types/auth.ts:55 |
HttpHeader
Defined in: packages/core/src/types/auth.ts:31
HTTP header for custom authentication.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name |
string |
Header name (e.g., “Authorization”). | packages/core/src/types/auth.ts:33 |
value |
string |
Header value (e.g., “Bearer token123”). | packages/core/src/types/auth.ts:35 |
Functions
createAuthConfig()
TypeScript
function createAuthConfig(options): AuthConfig;Defined in: packages/core/src/types/auth.ts:66
Create an AuthConfig from options. Automatically reads from environment variables if not provided.
Parameters
| Parameter | Type | Description |
|---|---|---|
options |
AuthConfigOptions |
Configuration options |
Returns
AuthConfig object
Throws
Error if header format is invalid
getAuthHeaders()
TypeScript
function getAuthHeaders(auth, isGitHub): Record<string, string>;Defined in: packages/core/src/types/auth.ts:97
Get authorization headers for a request.
Parameters
| Parameter | Type | Description |
|---|---|---|
auth |
AuthConfig | undefined |
Authentication configuration |
isGitHub |
boolean |
Whether this is a GitHub API request |
Returns
Record<string, string>
Headers object for fetch