Skip to content

Commit 5bcddf2

Browse files
authored
Merge pull request #1792 from dougm/issue-1785
Fix AttributeValue.C14N for 6.7u3
2 parents 5f2acf0 + a62b12c commit 5bcddf2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sts/client_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ import (
4343
// # restart the STS service:
4444
// % service-control --stop vmware-stsd
4545
// % service-control --start vmware-stsd
46-
// % tail -f /var/log/vmware/sso/catalina.$(date +%Y-%m-%d).log
46+
// % tail -f /var/log/vmware/sso/vmware-rest-idm-http.log
4747

4848
// solutionUserCreate ensures that solution user "govmomi-test" exists for uses with the tests that follow.
49-
func solutionUserCreate(ctx context.Context, info *url.Userinfo, sts *Client) error {
49+
func solutionUserCreate(ctx context.Context, info *url.Userinfo, sts *Client, vc *vim25.Client) error {
5050
s, err := sts.Issue(ctx, TokenRequest{Userinfo: info})
5151
if err != nil {
5252
return err
5353
}
5454

55-
admin, err := ssoadmin.NewClient(ctx, &vim25.Client{Client: sts.Client})
55+
admin, err := ssoadmin.NewClient(ctx, vc)
5656
if err != nil {
5757
return err
5858
}
@@ -132,7 +132,7 @@ func TestIssueHOK(t *testing.T) {
132132
t.Fatal(err)
133133
}
134134

135-
if err = solutionUserCreate(ctx, u.User, sts); err != nil {
135+
if err = solutionUserCreate(ctx, u.User, sts, c); err != nil {
136136
t.Fatal(err)
137137
}
138138

@@ -243,7 +243,7 @@ func TestIssueActAs(t *testing.T) {
243243
t.Fatal(err)
244244
}
245245

246-
if err = solutionUserCreate(ctx, u.User, sts); err != nil {
246+
if err = solutionUserCreate(ctx, u.User, sts, c); err != nil {
247247
t.Fatal(err)
248248
}
249249

sts/internal/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ type AttributeValue struct {
478478
}
479479

480480
func (a *AttributeValue) C14N() string {
481-
return fmt.Sprintf(`<saml2:AttributeValue xmlns:xsi="%s" xsi:type="xs:string">%s</saml2:AttributeValue>`, XSI, a.Value)
481+
return fmt.Sprintf(`<saml2:AttributeValue xmlns:xsi="%s" xsi:type="%s">%s</saml2:AttributeValue>`, XSI, a.Type, a.Value)
482482
}
483483

484484
type Attribute struct {

0 commit comments

Comments
 (0)