Skip to content

How should Auth::authorize() and similar work #14

@Morganamilo

Description

@Morganamilo

The spec says:

authorize(TokenParams?, AuthOptions?) => io TokenDetails // RSA10
createTokenRequest(TokenParams?, AuthOptions?) => io TokenRequest // RSA9
requestToken(TokenParams?, AuthOptions?) => io TokenDetails // RSA8e

The spec says these are optional. if missing it uses the configured defaults. This would make out API fn authorize(Option<&TokenParams>, Option<&AuthOptions>) . This is probably a little awkward.

Alternatively we could go for authorize(&TokenParams, &AuthOptions) and add functions to fetch the current defaults from auth. Meaning the user could do auth.authorize(auth.params(), auth.options()) for the defaults. we could then rename this function to authorize_with and make authorize a shortcut that just calls authorize_with with the defaults

Thoughts?

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions