Skip to content

Instantly share code, notes, and snippets.

func readBookDataset(protoInFile string) error {
var rLen uint32
var book typedefs.Book
r, err := os.Open(protoInFile)
if err != nil {
return err
}
defer r.Close()
func readBookDatasetOptimized(protoInFile string) error {
var rLen uint32
var book typedefs.Book
//Buffer to read bytes for decoding
var buf bytes.Buffer
done := false
//Fixed Length Buffer for reading from the file
rbuf := make([]byte, 1024)
r, err := os.Open(protoInFile)
if err != nil {
XML Element/Attribute Explanation
samlp:AuthnRequest Standard element to represent a SAML AuthnRequest
ID Unique value representing the ID of the request. When IDP responds, the assertion will have an attribute inResponseTo with the same value as this ID
Protocol-Binding Represents how the HTTP request for AuthnRequest is sent. The sample uses "Redirect" binding which means the payload is sent as query par
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="_423459839113526641" IssueInstant="2021-07-19T20:09:18+08:00"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Version="2.0">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
http://sp.samltools.com
</saml:Issuer>
</samlp:AuthnRequest>
<saml:Attribute
Name="email"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
<saml:AttributeValue xsi:type="xs:string">
[email protected]
</saml:AttributeValue>
</saml:Attribute>