Skip to content

Commit

Permalink
Fix struct tag syntax (closes PR #81)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellhaering committed Mar 1, 2023
1 parent 5b3023d commit 156f1b9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions types/response.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2016 Russell Haering et al.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -48,15 +48,15 @@ type Response struct {
}

type LogoutResponse struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol LogoutResponse"`
ID string `xml:"ID,attr"`
InResponseTo string `xml:"InResponseTo,attr"`
Destination string `xml:"Destination,attr"`
Version string `xml:"Version,attr"`
IssueInstant time.Time `xml:"IssueInstant,attr"`
Status *Status `xml:"Status"`
Issuer *Issuer `xml:"Issuer"`
SignatureValidated bool `xml:"-"` // not read, not dumped
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:protocol LogoutResponse"`
ID string `xml:"ID,attr"`
InResponseTo string `xml:"InResponseTo,attr"`
Destination string `xml:"Destination,attr"`
Version string `xml:"Version,attr"`
IssueInstant time.Time `xml:"IssueInstant,attr"`
Status *Status `xml:"Status"`
Issuer *Issuer `xml:"Issuer"`
SignatureValidated bool `xml:"-"` // not read, not dumped
}

type Status struct {
Expand Down Expand Up @@ -99,12 +99,12 @@ type Subject struct {
}

type AuthnContext struct {
XMLName xml.Name `xml:urn:oasis:names:tc:SAML:2.0:assertion AuthnContext"`
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion AuthnContext"`
AuthnContextClassRef *AuthnContextClassRef `xml:"AuthnContextClassRef"`
}

type AuthnContextClassRef struct {
XMLName xml.Name `xml:urn:oasis:names:tc:SAML:2.0:assertion AuthnContextClassRef"`
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion AuthnContextClassRef"`
Value string `xml:",chardata"`
}

Expand Down Expand Up @@ -175,12 +175,12 @@ type AttributeValue struct {
}

type AuthnStatement struct {
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion AuthnStatement"`
//Section 4.1.4.2 - https://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf
//If the identity provider supports the Single Logout profile, defined in Section 4.4
//, any such authentication statements MUST include a SessionIndex attribute to enable
//per-session logout requests by the service provider.
SessionIndex string `xml:"SessionIndex,attr,omitempty"`
XMLName xml.Name `xml:"urn:oasis:names:tc:SAML:2.0:assertion AuthnStatement"`
//Section 4.1.4.2 - https://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf
//If the identity provider supports the Single Logout profile, defined in Section 4.4
//, any such authentication statements MUST include a SessionIndex attribute to enable
//per-session logout requests by the service provider.
SessionIndex string `xml:"SessionIndex,attr,omitempty"`
AuthnInstant *time.Time `xml:"AuthnInstant,attr,omitempty"`
SessionNotOnOrAfter *time.Time `xml:"SessionNotOnOrAfter,attr,omitempty"`
AuthnContext *AuthnContext `xml:"AuthnContext"`
Expand Down

0 comments on commit 156f1b9

Please sign in to comment.