ワンクリックで
validate-connector-auth
Generate and run an auth verification test to confirm that collected credentials are valid.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Generate and run an auth verification test to confirm that collected credentials are valid.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Generate public-facing documentation for a connector targeted at end users.
Set up authentication for a source connector — generate connector spec, collect credentials interactively, and validate auth.
Run the authenticate script to collect credentials from the user via a browser form.
Guide the user through creating or updating a pipeline for a source connector — read the docs, build a pipeline spec interactively, and run create_pipeline or update_pipeline.
Generate the connector spec YAML file defining connection parameters and external options allowlist.
Single step only: audit a completed connector — implementation, testing & simulator validation, artifacts, security smells, cross-doc consistency — and produce a scored markdown review report. Read-mostly; does not modify connector code.
| name | validate-connector-auth |
| description | Generate and run an auth verification test to confirm that collected credentials are valid. |
| disable-model-invocation | true |
Generate and run an authentication verification test for the {{source_name}} connector to confirm that the supplied credentials are valid.
src/databricks/labs/community_connector/sources/{{source_name}}/{{source_name}}_api_doc.mdCONNECTOR_TEST_CONFIG_JSON env var — inline JSON.CONNECTOR_TEST_CONFIG_PATH env var — path to a JSON file.load_config.If no credentials resolve, stop and report that credentials have not been collected yet and ask user to provide.
tests/unit/sources/{{source_name}}/auth_test.py — a passing auth verification testCheck if tests/unit/sources/{{source_name}}/auth_test.py already exists.
Do NOT search for file locations — all paths are known. Do not run Glob/Search to discover files. Credential field names come from connector_spec.yaml (connection_parameters section), not from any specific on-disk config file.
Read src/databricks/labs/community_connector/sources/{{source_name}}/connector_spec.yaml to get the credential field names (connection_parameters), and read the authentication section of src/databricks/labs/community_connector/sources/{{source_name}}/{{source_name}}_api_doc.md to determine:
Generate a Python test file at tests/unit/sources/{{source_name}}/auth_test.py.
This script must:
load_config from tests.unit.sources.test_utils to load credentialsTemplate:
"""
Auth verification test for {SourceName} connector.
Run this script to verify your credentials are correctly configured.
Usage:
# via env var (inline JSON):
CONNECTOR_TEST_CONFIG_JSON='{"token":"..."}' \\
python tests/unit/sources/{source_name}/auth_test.py
# via env var (path to a JSON file at any location):
CONNECTOR_TEST_CONFIG_PATH=~/secrets/{source_name}.json \\
python tests/unit/sources/{source_name}/auth_test.py
"""
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', '..', '..'))
from tests.unit.sources.test_utils import load_config
import requests
def test_auth():
"""Verify supplied credentials are valid by making a simple API call."""
config = load_config() # honors CONNECTOR_TEST_CONFIG_JSON / _PATH env vars
# Build auth headers/params from config — customize based on auth method
# Example for Bearer token:
# headers = {"Authorization": f"Bearer {config['access_token']}"}
# Example for API key:
# headers = {"Authorization": f"Token token={config['api_key']}"}
# Example for Basic auth:
# auth = (config['email'], config['api_token'])
response = requests.get(
"{base_url}{verification_endpoint_path}",
headers=headers, # or auth=auth, etc.
timeout=10
)
if response.status_code == 200:
print(f"Authentication successful! Connected to {SourceName}.")
print(f" Response: {response.json()}")
return True
elif response.status_code == 401:
print(f"Authentication failed: Invalid credentials (HTTP 401).")
print(f" Check the credentials supplied via CONNECTOR_TEST_CONFIG_JSON / "
f"CONNECTOR_TEST_CONFIG_PATH.")
return False
elif response.status_code == 403:
print(f"Authorization failed: Insufficient permissions (HTTP 403).")
print(f" Ensure your credentials have the required scopes/permissions.")
return False
else:
print(f"Unexpected response: HTTP {response.status_code}")
print(f" Body: {response.text}")
return False
if __name__ == "__main__":
success = test_auth()
sys.exit(0 if success else 1)
Customize the template based on:
Run the test using the project virtual environment (Python 3.10+):
source .venv/bin/activate
python tests/unit/sources/{source_name}/auth_test.py
Debug if authentication fails and report the issue clearly.
load_configrequests library unless the source has an official Python SDK that simplifies auth significantlyconnection.oauth block, the auth test obtains an access token per the spec's flow and calls the API with it as a Bearer credential (Authorization: Bearer <access_token>). For m2m (client-credentials), POST client_id + client_secret (+ scopes) to token_url to get the access token — no user, no refresh token. For u2m / u2m_per_user, the collected credentials typically include client_id, client_secret, and a refresh_token; exchange the refresh token for an access token first.subdomain field in config.