New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation not clear about optional parameters for authentificatio #43
Comments
thanks @cderv for the issue Sorry about that, you are right that we need to fix this. I think we replace "optional" with "required". Unless you know of scenarios in which e.g., a username is required, but a pwd is not |
No I don't know this kind of scenarios. Mine was to not provide any username and password (for negotiate authentification) and it was not cleared if it was to be empty or NULL. So we probably should say it is required but can be set to NULL. And if it is required, shouldn't we put default value? |
what do you mean by "negotiate authentication"? |
I meant |
okay, in that case you still would need to provide a username and pwd, correct? |
No. I don't need any user or password. It is handle directly by libcurl and windows (I work on windows). On It worked in both case |
hmm, i kind of like that both |
Not sure to follow. At minimum, we need to document this to tell is required to fill |
What I mean by the same is that they don't set a default. look at the function definitions:
function (user, password, type = "basic")
{
stopifnot(is.character(user), length(user) == 1)
stopifnot(is.character(password), length(password) == 1)
stopifnot(is.character(type), length(type) == 1)
config(httpauth = auth_flags(type), userpwd = paste0(user,
":", password))
}
function (user, pwd, auth = "basic")
{
structure(ccp(list(userpwd = make_up(user, pwd), httpauth = auth_type(auth))),
class = "auth", type = auth)
} notice how the first two params in each fxn don't set a default value
having said that, yes, will document it better, and give egs for passing NULL to each if user doesn't want to provide user and/or pwd |
Oh I see. You are right. I missed this. |
will do soon |
In the documentation about
crul::auth()
is said to have all its argument optional.However,
crul::auth(auth = "any)
send back an errorit is because
crul:::make_up
does a check abour argumentuser
andpwd
which should not be emptyIt seems that it is expected to be set to
NULL
considering the code above the thecrul:::cpp
function.I check : with
auth(user = NULL, pwd = NULL, auth = "any")
it is working.It could be useful if this is explained in the documentation help page or maybe if the arguments are set to
NULL
by default.Either way, I can help with a PR if you want to change thing
The text was updated successfully, but these errors were encountered: