| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT license. |
| 3 | |
| 4 | package wstrustscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/ |
| 5 | |
| 6 | import ( |
| 7 | "contextscip-go gomod github.com/golang/go/src go1.18 context/" |
| 8 | "encoding/xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/" |
| 9 | "errorsscip-go gomod github.com/golang/go/src go1.18 errors/" |
| 10 | "fmtscip-go gomod github.com/golang/go/src go1.18 fmt/" |
| 11 | "net/httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/" |
| 12 | "net/urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/" |
| 13 | "reflectscip-go gomod github.com/golang/go/src go1.18 reflect/" |
| 14 | "regexpscip-go gomod github.com/golang/go/src go1.18 regexp/" |
| 15 | "stringsscip-go gomod github.com/golang/go/src go1.18 strings/" |
| 16 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 17 | |
| 18 | "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/" |
| 19 | "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/" |
| 20 | "github.com/kylelemons/godebug/diffscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/diff`/" |
| 21 | "github.com/kylelemons/godebug/prettyscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/pretty`/" |
| 22 | ) |
| 23 | |
| 24 | var testAuthorityEndpointsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/testAuthorityEndpoints. = authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.NewEndpointsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/NewEndpoints().( |
| 25 | "https://login.microsoftonline.com/v2.0/authorize", |
| 26 | "https://login.microsoftonline.com/v2.0/token", |
| 27 | "https://login.microsoftonline.com/v2.0", |
| 28 | "login.microsoftonline.com", |
| 29 | ) |
| 30 | |
| 31 | type fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller# struct { |
| 32 | errscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#err. bool |
| 33 | giveRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#giveResp. interface{} |
| 34 | |
| 35 | gotActionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotAction. string |
| 36 | gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint. string |
| 37 | gotQVscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotQV. urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.18 `net/url`/Values# |
| 38 | gotHeadersscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotHeaders. httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header# |
| 39 | gotBodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotBody. interface{} |
| 40 | gotRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotResp. interface{} |
| 41 | } |
| 42 | |
| 43 | func (f *fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#) XMLCallscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#XMLCall().(ctx contextscip-go gomod github.com/golang/go/src go1.18 context/.Contextscip-go gomod github.com/golang/go/src go1.18 context/Context#, endpoint string, headers httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header#, qv urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.18 `net/url`/Values#, resp interface{}) error { |
| 44 | if f.errscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#err. { |
| 45 | return errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("error") |
| 46 | } |
| 47 | f.gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint. = endpoint |
| 48 | f.gotHeadersscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotHeaders. = headers |
| 49 | f.gotQVscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotQV. = qv |
| 50 | f.gotRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotResp. = resp |
| 51 | return nil |
| 52 | } |
| 53 | |
| 54 | func (f *fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#) SOAPCallscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#SOAPCall().(ctx contextscip-go gomod github.com/golang/go/src go1.18 context/.Contextscip-go gomod github.com/golang/go/src go1.18 context/Context#, endpoint, action string, headers httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header#, qv urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.18 `net/url`/Values#, body string, resp interface{}) error { |
| 55 | if f.errscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#err. { |
| 56 | return errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("error") |
| 57 | } |
| 58 | f.gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint. = endpoint |
| 59 | f.gotActionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotAction. = action |
| 60 | f.gotHeadersscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotHeaders. = headers |
| 61 | f.gotQVscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotQV. = qv |
| 62 | f.gotBodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotBody. = body |
| 63 | f.gotRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotResp. = resp |
| 64 | |
| 65 | if f.giveRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#giveResp. != nil { |
| 66 | b, err := xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.MarshalIndentscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/MarshalIndent().(f.giveRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#giveResp., "", "\t") |
| 67 | if err != nil { |
| 68 | panic(err) |
| 69 | } |
| 70 | |
| 71 | if err := xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.Unmarshalscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Unmarshal().(b, resp); err != nil { |
| 72 | panic(err) |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return nil |
| 77 | } |
| 78 | |
| 79 | func (f *fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#) compareBasescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareBase().(endpoint string, headers httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header#, qv urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.18 `net/url`/Values#, resp interface{}) error { |
| 80 | if f.gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint. != endpoint { |
| 81 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("got endpoint == %s, want endpoint == %s", f.gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint., endpoint) |
| 82 | } |
| 83 | if diff := prettyscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/pretty`/.Comparescip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/pretty`/Compare().(headers, f.gotHeadersscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotHeaders.); diff != "" { |
| 84 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("headers -want/+got:\n%s", diff) |
| 85 | } |
| 86 | if diff := prettyscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/pretty`/.Comparescip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/pretty`/Compare().(qv, f.gotQVscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotQV.); diff != "" { |
| 87 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("qv -want/+got:\n%s", diff) |
| 88 | } |
| 89 | |
| 90 | gotValue := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(f.gotRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotResp.) |
| 91 | if gotValue.Kindscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Kind().() != reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.18 reflect/Ptr. { |
| 92 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("resp cannot be a non-pointer type") |
| 93 | } |
| 94 | gotValue = gotValue.Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().() |
| 95 | |
| 96 | gotName := gotValue.Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Namescip-go gomod github.com/golang/go/src go1.18 reflect/Type#Name().() |
| 97 | wantName := reflectscip-go gomod github.com/golang/go/src go1.18 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.18 reflect/ValueOf().(resp).Elemscip-go gomod github.com/golang/go/src go1.18 reflect/Value#Elem().().Typescip-go gomod github.com/golang/go/src go1.18 reflect/Value#Type().().Namescip-go gomod github.com/golang/go/src go1.18 reflect/Type#Name().() |
| 98 | |
| 99 | if gotName != wantName { |
| 100 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("resp type was %s, want %s", gotName, wantName) |
| 101 | } |
| 102 | return nil |
| 103 | } |
| 104 | |
| 105 | func (f *fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#) compareXMLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareXML().(endpoint string, resp interface{}) error { |
| 106 | if err := f.compareBasescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareBase().(endpoint, httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header#{}, urlscip-go gomod github.com/golang/go/src go1.18 `net/url`/.Valuesscip-go gomod github.com/golang/go/src go1.18 `net/url`/Values#{}, resp); err != nil { |
| 107 | return err |
| 108 | } |
| 109 | |
| 110 | return nil |
| 111 | } |
| 112 | |
| 113 | var replaceURNREscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/replaceURNRE. = regexpscip-go gomod github.com/golang/go/src go1.18 regexp/.MustCompilescip-go gomod github.com/golang/go/src go1.18 regexp/MustCompile().(`urn:uuid:.*</was:messageID>`) |
| 114 | |
| 115 | func (f *fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#) compareSOAPscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareSOAP().(action, endpoint string, body, resp interface{}) error { |
| 116 | if err := f.compareBasescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareBase().(endpoint, httpscip-go gomod github.com/golang/go/src go1.18 `net/http`/.Headerscip-go gomod github.com/golang/go/src go1.18 `net/http`/Header#{}, nil, resp); err != nil { |
| 117 | return err |
| 118 | } |
| 119 | |
| 120 | if f.gotActionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotAction. != action { |
| 121 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("got endpoint == %s, want endpoint == %s", f.gotEndpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#gotEndpoint., endpoint) |
| 122 | } |
| 123 | |
| 124 | // Removes a uuid that will change every time. |
| 125 | // example: `urn:uuid:373ea2fa-d586-4cad-8bb8-10392ddbb5c6</wsa:messageID>`` |
| 126 | bodyStr := replaceURNREscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/replaceURNRE..ReplaceAllStringscip-go gomod github.com/golang/go/src go1.18 regexp/Regexp#ReplaceAllString().(body.(string), `</was:messageID>`) |
| 127 | gotBodyStr := replaceURNREscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/replaceURNRE..ReplaceAllStringscip-go gomod github.com/golang/go/src go1.18 regexp/Regexp#ReplaceAllString().(body.(string), `</was:messageID>`) |
| 128 | |
| 129 | if diff := diffscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/diff`/.Diffscip-go gomod github.com/kylelemons/godebug v1.1.0 `github.com/kylelemons/godebug/diff`/Diff().( |
| 130 | stringsscip-go gomod github.com/golang/go/src go1.18 strings/.ReplaceAllscip-go gomod github.com/golang/go/src go1.18 strings/ReplaceAll().(bodyStr, ">", ">\n"), // So we can do a line by line comparison |
| 131 | stringsscip-go gomod github.com/golang/go/src go1.18 strings/.ReplaceAllscip-go gomod github.com/golang/go/src go1.18 strings/ReplaceAll().(gotBodyStr, ">", ">\n"), // So we can do a line by line comparison |
| 132 | ); diff != "" { |
| 133 | return fmtscip-go gomod github.com/golang/go/src go1.18 fmt/.Errorfscip-go gomod github.com/golang/go/src go1.18 fmt/Errorf().("body -want/+got:\n%s", diff) |
| 134 | } |
| 135 | return nil |
| 136 | } |
| 137 | |
| 138 | func TestMexscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/TestMex().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 139 | tests := []struct { |
| 140 | desc string |
| 141 | err bool |
| 142 | createErr bool |
| 143 | newFromDef func(d defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Definitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Definitions#) (defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.MexDocumentscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/MexDocument#, error) |
| 144 | federationMetadataURL string |
| 145 | }{ |
| 146 | { |
| 147 | desc: "Error: comm returns error", |
| 148 | err: true, |
| 149 | }, |
| 150 | { |
| 151 | desc: "Definition was bad", |
| 152 | federationMetadataURL: "", |
| 153 | newFromDef: func(d defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Definitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Definitions#) (defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.MexDocumentscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/MexDocument#, error) { |
| 154 | return defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.MexDocumentscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/MexDocument#{}, errorsscip-go gomod github.com/golang/go/src go1.18 errors/.Newscip-go gomod github.com/golang/go/src go1.18 errors/New().("error") |
| 155 | }, |
| 156 | err: true, |
| 157 | }, |
| 158 | { |
| 159 | desc: "Success", |
| 160 | federationMetadataURL: "", |
| 161 | newFromDef: func(d defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Definitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Definitions#) (defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.MexDocumentscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/MexDocument#, error) { |
| 162 | return defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.MexDocumentscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/MexDocument#{}, nil |
| 163 | }, |
| 164 | }, |
| 165 | } |
| 166 | |
| 167 | defer func() { newFromDefscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/newFromDef. = defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.NewFromDefscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/NewFromDef(). }() |
| 168 | |
| 169 | for _, test := range tests { |
| 170 | newFromDefscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/newFromDef. = test.newFromDef |
| 171 | |
| 172 | fake := &fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#{errscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#err.: test.err} |
| 173 | client := Clientscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#{Commscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#Comm.: fake} |
| 174 | |
| 175 | // We don't care about the result, that is just a translation from the XML handled |
| 176 | // in the comm package via wstrust.CreateWsTrustMexDocumentFromDef(). |
| 177 | // We care only that the comm package got what the right inputs. |
| 178 | _, err := client.Mexscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#Mex().(contextscip-go gomod github.com/golang/go/src go1.18 context/.Backgroundscip-go gomod github.com/golang/go/src go1.18 context/Background().(), "http://something") |
| 179 | switch { |
| 180 | case err == nil && test.err: |
| 181 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestMex(%s): got err == nil , want err != nil", test.desc) |
| 182 | continue |
| 183 | case err != nil && !test.err: |
| 184 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestMex(%s): got err == %s , want err == nil", test.desc, err) |
| 185 | continue |
| 186 | case err != nil: |
| 187 | continue |
| 188 | } |
| 189 | |
| 190 | if err := fake.compareXMLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareXML().("http://something", &defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Definitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Definitions#{}); err != nil { |
| 191 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestMex(%s): %s", test.desc, err) |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func TestSAMLTokenInfoscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/TestSAMLTokenInfo().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 197 | authParams := authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.AuthParamsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#{ |
| 198 | Usernamescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#Username.: "username", |
| 199 | Passwordscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#Password.: "password", |
| 200 | Endpointsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#Endpoints.: testAuthorityEndpointsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/testAuthorityEndpoints., |
| 201 | ClientIDscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#ClientID.: "clientID", |
| 202 | } |
| 203 | |
| 204 | // Note: We don't tests any error conditions built on buildTokenRequestMessage(), |
| 205 | // as they can only fail if the xml marshaller fails. |
| 206 | tests := []struct { |
| 207 | desc string |
| 208 | err bool |
| 209 | commErr bool |
| 210 | endpoint defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Endpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint# |
| 211 | body string |
| 212 | action string |
| 213 | authorizationType authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.AuthorizeTypescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthorizeType# |
| 214 | giveResp defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions# |
| 215 | }{ |
| 216 | { |
| 217 | desc: "Error: comm returns error", |
| 218 | err: true, |
| 219 | commErr: true, |
| 220 | endpoint: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Endpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#{Versionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#Version.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Trust13scip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Trust13., URLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#URL.: "upEndpoint"}, |
| 221 | action: SoapActionDefaultscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/SoapActionDefault., |
| 222 | authorizationType: authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.ATWindowsIntegratedscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/ATWindowsIntegrated., |
| 223 | body: "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><s:Header><wsa:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</wsa:Action><wsa:messageID>urn:uuid:fb8ec65b-f117-468f-b4e8-50c5e802affe</wsa:messageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:To s:mustUnderstand=\"1\">upEndpoint</wsa:To><wsse:Security s:mustUnderstand=\"\" xmlns:wsse=\"\"><wsu:Timestamp wsu:Id=\"\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id=\"\"><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken></wsse:Security></s:Header><s:Body><wst:RequestSecurityToken xmlns:wst=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\"><wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><wsa:EndpointReference><wsa:Address>urn</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><wst:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</wst:KeyType><wst:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</wst:RequestType></wst:RequestSecurityToken></s:Body></s:Envelope>", |
| 224 | giveResp: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#{ |
| 225 | Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#Body.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#{ |
| 226 | RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#RequestSecurityTokenResponseCollection.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#{ |
| 227 | RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#RequestSecurityTokenResponse.: []defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#{ |
| 228 | { |
| 229 | RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#RequestedSecurityToken.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#{ |
| 230 | Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#Assertion.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#{ |
| 231 | Textscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Text.: "hello", |
| 232 | XMLNamescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#XMLName.: xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.Namescip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#{ |
| 233 | Localscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#Local.: "Assertion", |
| 234 | }, |
| 235 | Samlscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Saml.: samlv1Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/samlv1Assertion., |
| 236 | }, |
| 237 | }, |
| 238 | }, |
| 239 | }, |
| 240 | }, |
| 241 | }, |
| 242 | }, |
| 243 | }, |
| 244 | { |
| 245 | desc: "Error: Trust2005 endpoint, which isn't supported", |
| 246 | err: true, |
| 247 | endpoint: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Endpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#{Versionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#Version.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Trust2005scip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Trust2005., URLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#URL.: "upEndpoint"}, |
| 248 | action: SoapActionDefaultscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/SoapActionDefault., |
| 249 | authorizationType: authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.ATWindowsIntegratedscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/ATWindowsIntegrated., |
| 250 | body: "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><s:Header><wsa:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</wsa:Action><wsa:messageID>urn:uuid:fb8ec65b-f117-468f-b4e8-50c5e802affe</wsa:messageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:To s:mustUnderstand=\"1\">upEndpoint</wsa:To><wsse:Security s:mustUnderstand=\"\" xmlns:wsse=\"\"><wsu:Timestamp wsu:Id=\"\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id=\"\"><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken></wsse:Security></s:Header><s:Body><wst:RequestSecurityToken xmlns:wst=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\"><wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><wsa:EndpointReference><wsa:Address>urn</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><wst:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</wst:KeyType><wst:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</wst:RequestType></wst:RequestSecurityToken></s:Body></s:Envelope>", |
| 251 | giveResp: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#{ |
| 252 | Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#Body.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#{ |
| 253 | RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#RequestSecurityTokenResponseCollection.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#{ |
| 254 | RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#RequestSecurityTokenResponse.: []defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#{ |
| 255 | { |
| 256 | RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#RequestedSecurityToken.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#{ |
| 257 | Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#Assertion.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#{ |
| 258 | Textscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Text.: "hello", |
| 259 | XMLNamescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#XMLName.: xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.Namescip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#{ |
| 260 | Localscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#Local.: "Assertion", |
| 261 | }, |
| 262 | Samlscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Saml.: samlv1Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/samlv1Assertion., |
| 263 | }, |
| 264 | }, |
| 265 | }, |
| 266 | }, |
| 267 | }, |
| 268 | }, |
| 269 | }, |
| 270 | }, |
| 271 | { |
| 272 | desc: "Success: SAMLV1 assertion with AuthorizationTypeWindowsIntegratedAuth", |
| 273 | endpoint: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Endpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#{Versionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#Version.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Trust13scip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Trust13., URLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#URL.: "upEndpoint"}, |
| 274 | action: SoapActionDefaultscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/SoapActionDefault., |
| 275 | authorizationType: authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.ATWindowsIntegratedscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/ATWindowsIntegrated., |
| 276 | body: "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><s:Header><wsa:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</wsa:Action><wsa:messageID>urn:uuid:fb8ec65b-f117-468f-b4e8-50c5e802affe</wsa:messageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:To s:mustUnderstand=\"1\">upEndpoint</wsa:To><wsse:Security s:mustUnderstand=\"\" xmlns:wsse=\"\"><wsu:Timestamp wsu:Id=\"\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id=\"\"><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken></wsse:Security></s:Header><s:Body><wst:RequestSecurityToken xmlns:wst=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\"><wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><wsa:EndpointReference><wsa:Address>urn</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><wst:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</wst:KeyType><wst:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</wst:RequestType></wst:RequestSecurityToken></s:Body></s:Envelope>", |
| 277 | giveResp: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#{ |
| 278 | Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#Body.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#{ |
| 279 | RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#RequestSecurityTokenResponseCollection.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#{ |
| 280 | RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#RequestSecurityTokenResponse.: []defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#{ |
| 281 | { |
| 282 | RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#RequestedSecurityToken.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#{ |
| 283 | Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#Assertion.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#{ |
| 284 | Textscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Text.: "hello", |
| 285 | XMLNamescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#XMLName.: xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.Namescip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#{ |
| 286 | Localscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#Local.: "Assertion", |
| 287 | }, |
| 288 | Samlscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Saml.: samlv1Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/samlv1Assertion., |
| 289 | }, |
| 290 | }, |
| 291 | }, |
| 292 | }, |
| 293 | }, |
| 294 | }, |
| 295 | }, |
| 296 | }, |
| 297 | { |
| 298 | desc: "Success: SAMLV2 assertion with AuthorizationTypeUsernamePassword", |
| 299 | endpoint: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Endpointscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#{Versionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#Version.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Trust13scip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Trust13., URLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#URL.: "upEndpoint"}, |
| 300 | action: SoapActionDefaultscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/SoapActionDefault., |
| 301 | authorizationType: authorityscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/.ATUsernamePasswordscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/ATUsernamePassword., |
| 302 | body: "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\"><s:Header><wsa:Action s:mustUnderstand=\"1\">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</wsa:Action><wsa:messageID>urn:uuid:fb8ec65b-f117-468f-b4e8-50c5e802affe</wsa:messageID><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address></wsa:ReplyTo><wsa:To s:mustUnderstand=\"1\">upEndpoint</wsa:To><wsse:Security s:mustUnderstand=\"\" xmlns:wsse=\"\"><wsu:Timestamp wsu:Id=\"\"><wsu:Created></wsu:Created><wsu:Expires></wsu:Expires></wsu:Timestamp><wsse:UsernameToken wsu:Id=\"\"><wsse:Username></wsse:Username><wsse:Password></wsse:Password></wsse:UsernameToken></wsse:Security></s:Header><s:Body><wst:RequestSecurityToken xmlns:wst=\"http://docs.oasis-open.org/ws-sx/ws-trust/200512\"><wsp:AppliesTo xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\"><wsa:EndpointReference><wsa:Address>urn</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><wst:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</wst:KeyType><wst:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</wst:RequestType></wst:RequestSecurityToken></s:Body></s:Envelope>", |
| 303 | giveResp: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#{ |
| 304 | Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#Body.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Bodyscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#{ |
| 305 | RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Body#RequestSecurityTokenResponseCollection.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponseCollectionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#{ |
| 306 | RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponseCollection#RequestSecurityTokenResponse.: []defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestSecurityTokenResponsescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#{ |
| 307 | { |
| 308 | RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestSecurityTokenResponse#RequestedSecurityToken.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.RequestedSecurityTokenscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#{ |
| 309 | Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/RequestedSecurityToken#Assertion.: defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#{ |
| 310 | Textscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Text.: "hello", |
| 311 | XMLNamescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#XMLName.: xmlscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/.Namescip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#{ |
| 312 | Localscip-go gomod github.com/golang/go/src go1.18 `encoding/xml`/Name#Local.: "Assertion", |
| 313 | }, |
| 314 | Samlscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Assertion#Saml.: samlv2Assertionscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/samlv2Assertion., |
| 315 | }, |
| 316 | }, |
| 317 | }, |
| 318 | }, |
| 319 | }, |
| 320 | }, |
| 321 | }, |
| 322 | }, |
| 323 | } |
| 324 | |
| 325 | for _, test := range tests { |
| 326 | fake := &fakeXMLCallerscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#{errscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#err.: test.commErr, giveRespscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#giveResp.: test.giveResp} |
| 327 | client := Clientscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#{Commscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#Comm.: fake} |
| 328 | |
| 329 | authParams.AuthorizationTypescip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority`/AuthParams#AuthorizationType. = test.authorizationType |
| 330 | |
| 331 | // We don't care about the result, that is just a translation from the XML handled |
| 332 | // in the comm package via wstrust.CreateWsTrustMexDocumentFromDef(). |
| 333 | // We care only that the comm package got the right inputs. |
| 334 | _, err := client.SAMLTokenInfoscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/Client#SAMLTokenInfo().(contextscip-go gomod github.com/golang/go/src go1.18 context/.Backgroundscip-go gomod github.com/golang/go/src go1.18 context/Background().(), authParams, "urn", test.endpoint) |
| 335 | switch { |
| 336 | case err == nil && test.err: |
| 337 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestSAMLTokenInfo(%s): got err == nil , want err != nil", test.desc) |
| 338 | continue |
| 339 | case err != nil && !test.err: |
| 340 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestSAMLTokenInfo(%s): got err == %s , want err == nil", test.desc, err) |
| 341 | continue |
| 342 | case err != nil: |
| 343 | continue |
| 344 | } |
| 345 | |
| 346 | if err := fake.compareSOAPscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust`/fakeXMLCaller#compareSOAP().(test.action, test.endpoint.URLscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/Endpoint#URL., test.body, &defsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/.SAMLDefinitionsscip-go gomod github.com/AzureAD/microsoft-authentication-library-for-go . `github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs`/SAMLDefinitions#{}); err != nil { |
| 347 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().("TestSAMLTokenInfo(%s): %s", test.desc, err) |
| 348 | } |
| 349 | } |
| 350 | } |