From 0d6f7fde0cfe5744acb90b3a40998e0b03139e3b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 4 Nov 2020 17:21:50 -0500 Subject: [PATCH] frontend/Mi: add tokenIntrospectURL --- frontend/src/Mi.elm | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/Mi.elm b/frontend/src/Mi.elm index 917935e..3cc26a6 100644 --- a/frontend/src/Mi.elm +++ b/frontend/src/Mi.elm @@ -1,12 +1,15 @@ -module Mi exposing (TokenData, errorToString, expectJson, request, tokenDecoder) +module Mi exposing (TokenData, errorToString, expectJson, request, tokenDecoder, tokenIntrospectURL) import Http exposing (Error(..)) import Json.Decode as D +import Url.Builder as UB type alias TokenData = { sub : String - , jti : String, aud: String, iss: String + , jti : String + , aud : String + , iss : String } @@ -19,6 +22,13 @@ tokenDecoder = (D.field "iss" D.string) +tokenIntrospectURL : String +tokenIntrospectURL = + UB.absolute + [ "api", "token", "info" ] + [] + + request method token path body expect = Http.request { method = method @@ -75,4 +85,4 @@ errorToString err = "Unexpected response from api: " ++ text BadUrl url -> - "Malformed url: " ++ url \ No newline at end of file + "Malformed url: " ++ url