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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func serializeBookDataset(protoOutFile string) error { | |
w, err := os.OpenFile(protoOutFile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) | |
if err != nil { | |
return err | |
} | |
defer w.Close() | |
csvFile, err := os.Open("books.csv") | |
if err != nil { | |
return err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func readOps(outfile string) error { | |
in, err := ioutil.ReadFile(outfile) | |
if err != nil { | |
return err | |
} | |
instructions := &typedefs.Instructions{} | |
if err := proto.Unmarshal(in, instructions); err != nil { | |
return err | |
} | |
for _, patch := range instructions.Operations { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax='proto3'; | |
package typedefs; | |
option go_package ='./typedefs'; | |
message Patch{ | |
message Copy{ | |
int64 start =1; | |
int64 end=2; | |
} | |
message Insert{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func writeOps(outfile string) error { | |
f, err := os.OpenFile(outfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) | |
if err != nil { | |
log.Fatalf("Failed to create file %s", err.Error()) | |
} | |
defer f.Close() | |
op1 := &typedefs.Patch_Copy{Start: 10, End: 100} | |
op2 := &typedefs.Patch_Insert{RawBytes: []byte{'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e'}} | |
ops := []*typedefs.Patch{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unc runTestServer() string { | |
slowServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
incoming, _ := httputil.DumpRequest(r, false) | |
fmt.Printf("Server: Incoming Request %s", string(incoming)) | |
ctx := r.Context() | |
echan := make(chan error) | |
go func() { | |
time.Sleep(12 * time.Second) // Do difficult Job | |
_, err := w.Write([]byte("Hello There!")) | |
echan <- err |
NewerOlder