| 1 |
|
| MODULE = Git::Raw PACKAGE = Git::Raw::Cred |
| 2 |
|
| |
| 3 |
|
| Cred |
| 4 |
|
| userpass(class, user, pass) |
| 5 |
|
| SV *class |
| 6 |
|
| SV *user |
| 7 |
|
| SV *pass |
| 8 |
|
| |
| 9 |
|
| PREINIT: |
| 10 |
|
| int rc; |
| 11 |
|
| |
| 12 |
|
| Cred out; |
| 13 |
|
| git_cred *cred; |
| 14 |
|
| |
| 15 |
|
| CODE: |
| 16 |
0 |
| rc = git_cred_userpass_plaintext_new( |
| 17 |
|
| &cred, |
| 18 |
|
| git_ensure_pv(user, "user"), |
| 19 |
|
| git_ensure_pv(pass, "pass") |
| 20 |
|
| ); |
| 21 |
0 |
| git_check_error(rc); |
| 22 |
|
| |
| 23 |
0 |
| Newxz(out, 1, git_raw_cred); |
| 24 |
0 |
| out -> cred = cred; |
| 25 |
0 |
| RETVAL = out; |
| 26 |
|
| |
| 27 |
|
| OUTPUT: RETVAL |
| 28 |
|
| |
| 29 |
|
| Cred |
| 30 |
|
| sshkey(class, user, public, private, ...) |
| 31 |
|
| SV *class |
| 32 |
|
| SV *user |
| 33 |
|
| SV *public |
| 34 |
|
| SV *private |
| 35 |
|
| |
| 36 |
|
| PROTOTYPE: $$$$;$ |
| 37 |
|
| PREINIT: |
| 38 |
|
| int rc; |
| 39 |
|
| |
| 40 |
|
| Cred out; |
| 41 |
|
| git_cred *cred; |
| 42 |
0 |
| const char *passphrase = NULL; |
| 43 |
|
| |
| 44 |
|
| CODE: |
| 45 |
0 |
▶ | if (items == 5) |
Branch: 1 branch
| Branch | True | False | Total |
| if (items == 5) |
0 |
0 |
0 |
|
| 46 |
0 |
| passphrase = git_ensure_pv(ST(4), "pass"); |
| 47 |
|
| |
| 48 |
0 |
| rc = git_cred_ssh_key_new( |
| 49 |
|
| &cred, |
| 50 |
|
| git_ensure_pv(user, "user"), |
| 51 |
|
| git_ensure_pv(public, "public"), |
| 52 |
|
| git_ensure_pv(private, "private"), |
| 53 |
|
| passphrase |
| 54 |
|
| ); |
| 55 |
0 |
| git_check_error(rc); |
| 56 |
|
| |
| 57 |
0 |
| Newxz(out, 1, git_raw_cred); |
| 58 |
0 |
| out -> cred = cred; |
| 59 |
0 |
| RETVAL = out; |
| 60 |
|
| |
| 61 |
|
| OUTPUT: RETVAL |
| 62 |
|
| |
| 63 |
|
| Cred |
| 64 |
|
| sshagent(class, user) |
| 65 |
|
| SV *class |
| 66 |
|
| SV *user |
| 67 |
|
| |
| 68 |
|
| PREINIT: |
| 69 |
|
| int rc; |
| 70 |
|
| |
| 71 |
|
| Cred out; |
| 72 |
|
| git_cred *cred; |
| 73 |
|
| |
| 74 |
|
| CODE: |
| 75 |
0 |
| rc = git_cred_ssh_key_from_agent( |
| 76 |
|
| &cred, |
| 77 |
|
| git_ensure_pv(user, "user") |
| 78 |
|
| ); |
| 79 |
0 |
| git_check_error(rc); |
| 80 |
|
| |
| 81 |
0 |
| Newxz(out, 1, git_raw_cred); |
| 82 |
0 |
| out -> cred = cred; |
| 83 |
0 |
| RETVAL = out; |
| 84 |
|
| |
| 85 |
|
| OUTPUT: RETVAL |
| 86 |
|
| |
| 87 |
|
| Cred |
| 88 |
|
| sshinteractive(class, user, callback) |
| 89 |
|
| SV *class |
| 90 |
|
| SV *user |
| 91 |
|
| SV *callback |
| 92 |
|
| |
| 93 |
|
| PREINIT: |
| 94 |
|
| int rc; |
| 95 |
|
| |
| 96 |
|
| Cred out; |
| 97 |
|
| git_cred *cred; |
| 98 |
|
| |
| 99 |
|
| CODE: |
| 100 |
0 |
| rc = git_cred_ssh_interactive_new( |
| 101 |
|
| &cred, |
| 102 |
|
| git_ensure_pv(user, "user"), |
| 103 |
|
| (git_cred_ssh_interactive_callback) git_ssh_interactive_cbb, |
| 104 |
0 |
| git_ensure_cv(callback, "callback")); |
| 105 |
0 |
| git_check_error(rc); |
| 106 |
|
| |
| 107 |
0 |
| Newxz(out, 1, git_raw_cred); |
| 108 |
0 |
| out -> cred = cred; |
| 109 |
0 |
| out -> callback = callback; |
| 110 |
0 |
| SvREFCNT_inc(out -> callback); |
| 111 |
|
| |
| 112 |
0 |
| RETVAL = out; |
| 113 |
|
| |
| 114 |
|
| OUTPUT: RETVAL |
| 115 |
|
| |
| 116 |
|
| void |
| 117 |
|
| DESTROY(self) |
| 118 |
|
| SV *self |
| 119 |
|
| |
| 120 |
|
| PREINIT: |
| 121 |
|
| Cred cred; |
| 122 |
|
| |
| 123 |
|
| CODE: |
| 124 |
0 |
| cred = GIT_SV_TO_PTR(Cred, self); |
| 125 |
|
| |
| 126 |
0 |
| SvREFCNT_dec(cred -> callback); |
| 127 |
0 |
| Safefree(cred); |