mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
auth/credentials: add python bindings for enum credentials_obtained
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
9fa7f59f88
commit
7c344fbbe0
@ -528,12 +528,12 @@ static PyMethodDef py_creds_methods[] = {
|
||||
{ "get_username", py_creds_get_username, METH_NOARGS,
|
||||
"S.get_username() -> username\nObtain username." },
|
||||
{ "set_username", py_creds_set_username, METH_VARARGS,
|
||||
"S.set_username(name, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_username(name[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change username." },
|
||||
{ "get_principal", py_creds_get_principal, METH_NOARGS,
|
||||
"S.get_principal() -> user@realm\nObtain user principal." },
|
||||
{ "set_principal", py_creds_set_principal, METH_VARARGS,
|
||||
"S.set_principal(name, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_principal(name[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change principal." },
|
||||
{ "get_password", py_creds_get_password, METH_NOARGS,
|
||||
"S.get_password() -> password\n"
|
||||
@ -542,31 +542,31 @@ static PyMethodDef py_creds_methods[] = {
|
||||
"S.get_ntlm_username_domain() -> (domain, username)\n"
|
||||
"Obtain NTLM username and domain, split up either as (DOMAIN, user) or (\"\", \"user@realm\")." },
|
||||
{ "set_password", py_creds_set_password, METH_VARARGS,
|
||||
"S.set_password(password, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_password(password[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change password." },
|
||||
{ "set_utf16_password", py_creds_set_utf16_password, METH_VARARGS,
|
||||
"S.set_utf16_password(password, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_utf16_password(password[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change password." },
|
||||
{ "get_old_password", py_creds_get_old_password, METH_NOARGS,
|
||||
"S.get_old_password() -> password\n"
|
||||
"Obtain old password." },
|
||||
{ "set_old_password", py_creds_set_old_password, METH_VARARGS,
|
||||
"S.set_old_password(password, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_old_password(password[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change old password." },
|
||||
{ "set_old_utf16_password", py_creds_set_old_utf16_password, METH_VARARGS,
|
||||
"S.set_old_utf16_password(password, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_old_utf16_password(password[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change old password." },
|
||||
{ "get_domain", py_creds_get_domain, METH_NOARGS,
|
||||
"S.get_domain() -> domain\n"
|
||||
"Obtain domain name." },
|
||||
{ "set_domain", py_creds_set_domain, METH_VARARGS,
|
||||
"S.set_domain(domain, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_domain(domain[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change domain name." },
|
||||
{ "get_realm", py_creds_get_realm, METH_NOARGS,
|
||||
"S.get_realm() -> realm\n"
|
||||
"Obtain realm name." },
|
||||
{ "set_realm", py_creds_set_realm, METH_VARARGS,
|
||||
"S.set_realm(realm, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.set_realm(realm[, credentials.SPECIFIED]) -> None\n"
|
||||
"Change realm name." },
|
||||
{ "get_bind_dn", py_creds_get_bind_dn, METH_NOARGS,
|
||||
"S.get_bind_dn() -> bind dn\n"
|
||||
@ -592,10 +592,10 @@ static PyMethodDef py_creds_methods[] = {
|
||||
"S.set_cmdline_callbacks() -> bool\n"
|
||||
"Use command-line to obtain credentials not explicitly set." },
|
||||
{ "parse_string", py_creds_parse_string, METH_VARARGS,
|
||||
"S.parse_string(text, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.parse_string(text[, credentials.SPECIFIED]) -> None\n"
|
||||
"Parse credentials string." },
|
||||
{ "parse_file", py_creds_parse_file, METH_VARARGS,
|
||||
"S.parse_file(filename, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"S.parse_file(filename[, credentials.SPECIFIED]) -> None\n"
|
||||
"Parse credentials file." },
|
||||
{ "set_password_will_be_nt_hash",
|
||||
py_cli_credentials_set_password_will_be_nt_hash, METH_VARARGS,
|
||||
@ -649,6 +649,13 @@ void initcredentials(void)
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
||||
PyModule_AddObject(m, "UNINITIALISED", PyInt_FromLong(CRED_UNINITIALISED));
|
||||
PyModule_AddObject(m, "CALLBACK", PyInt_FromLong(CRED_CALLBACK));
|
||||
PyModule_AddObject(m, "GUESS_ENV", PyInt_FromLong(CRED_GUESS_ENV));
|
||||
PyModule_AddObject(m, "GUESS_FILE", PyInt_FromLong(CRED_GUESS_FILE));
|
||||
PyModule_AddObject(m, "CALLBACK_RESULT", PyInt_FromLong(CRED_CALLBACK_RESULT));
|
||||
PyModule_AddObject(m, "SPECIFIED", PyInt_FromLong(CRED_SPECIFIED));
|
||||
|
||||
PyModule_AddObject(m, "AUTO_USE_KERBEROS", PyInt_FromLong(CRED_AUTO_USE_KERBEROS));
|
||||
PyModule_AddObject(m, "DONT_USE_KERBEROS", PyInt_FromLong(CRED_DONT_USE_KERBEROS));
|
||||
PyModule_AddObject(m, "MUST_USE_KERBEROS", PyInt_FromLong(CRED_MUST_USE_KERBEROS));
|
||||
|
Loading…
x
Reference in New Issue
Block a user