MCPcopy Create free account
hub / github.com/libgit2/pygit2 / credentials

Method credentials

test/test_credentials.py:142–149  ·  view source on GitHub ↗
(
            self,
            url: str,
            username_from_url: str | None,
            allowed_types: CredentialType,
        )

Source from the content-addressed store, hash-verified

140def test_callback(testrepo: Repository) -> None:
141 class MyCallbacks(pygit2.RemoteCallbacks):
142 def credentials(
143 self,
144 url: str,
145 username_from_url: str | None,
146 allowed_types: CredentialType,
147 ) -> Username | UserPass | Keypair:
148 assert allowed_types & CredentialType.USERPASS_PLAINTEXT
149 raise Exception("I don't know the password")
150
151 url = 'https://github.com/github/github'
152 remote = testrepo.remotes.create('github', url)

Callers

nothing calls this directly

Calls 1

KeypairClass · 0.90

Tested by

no test coverage detected