spotless/oauth_2_1/authorization
Types
pub type Code {
InvalidRequest
UnauthorizedClient
AccessDenied
UnsupportedResponseType
InvalidScope
ServerError
TemporarilyUnavailable
}
Constructors
-
InvalidRequest -
UnauthorizedClient -
AccessDenied -
UnsupportedResponseType -
InvalidScope -
ServerError -
TemporarilyUnavailable
pub type Request {
Request(
client_id: String,
code_challenge: String,
code_challenge_method: proof_key_for_code_exchange.CodeChallengeMethod,
redirect_uri: String,
scope: List(String),
state: String,
extra: List(#(String, String)),
)
}
Constructors
-
Request( client_id: String, code_challenge: String, code_challenge_method: proof_key_for_code_exchange.CodeChallengeMethod, redirect_uri: String, scope: List(String), state: String, extra: List(#(String, String)), )
pub type Response {
Response(
code: String,
state: option.Option(String),
iss: option.Option(String),
)
}
Constructors
-
Response( code: String, state: option.Option(String), iss: option.Option(String), )
Values
pub fn error_code_from_string(raw: String) -> Result(Code, Nil)
pub fn error_code_to_string(code: Code) -> String
pub fn request_from_http(
request: request.Request(a),
) -> Result(Request, #(Code, String))
pub fn request_to_http(
endpoint: #(origin.Origin, String),
request: Request,
) -> request.Request(BitArray)
pub fn request_to_params(
request: Request,
) -> List(#(String, String))
pub fn request_to_url(
endpoint: #(origin.Origin, String),
request: Request,
) -> uri.Uri
pub fn response_from_http(
request: request.Request(a),
) -> Result(Response, #(Code, String))
pub fn response_from_params(
params: List(#(String, String)),
) -> Result(Response, #(Code, String))
pub fn response_from_query(
query: option.Option(String),
) -> Result(
Result(Response, #(Code, option.Option(String))),
#(String, option.Option(String)),
)
Nested result, outer for following the protocol inner for defined error responses
pub fn response_to_params(
response: Response,
) -> List(#(String, String))
pub fn response_to_url(
endpoint: #(origin.Origin, String),
response: Response,
) -> String