MCPcopy
hub / github.com/coderamp-labs/gitingest / validate_github_token

Function validate_github_token

src/gitingest/utils/git_utils.py:313–328  ·  view source on GitHub ↗

Validate the format of a GitHub Personal Access Token. Parameters ---------- token : str GitHub personal access token (PAT) for accessing private repositories. Raises ------ InvalidGitHubTokenError If the token format is invalid.

(token: str)

Source from the content-addressed store, hash-verified

311
312
313def validate_github_token(token: str) -> None:
314 """Validate the format of a GitHub Personal Access Token.
315
316 Parameters
317 ----------
318 token : str
319 GitHub personal access token (PAT) for accessing private repositories.
320
321 Raises
322 ------
323 InvalidGitHubTokenError
324 If the token format is invalid.
325
326 """
327 if not re.fullmatch(_GITHUB_PAT_PATTERN, token):
328 raise InvalidGitHubTokenError
329
330
331async def checkout_partial_clone(config: CloneConfig, token: str | None) -> None:

Callers 4

resolve_tokenFunction · 0.90
process_queryFunction · 0.90

Calls

no outgoing calls