Commit ed287270 authored by owlo's avatar owlo

hackey encryption removal

parent c099925d
No preview for this file type
......@@ -466,7 +466,10 @@ func main() {
//w.Header().Set("Authentication", signature)
w.WriteHeader(http.StatusOK)
fmt.Println("Signing test json.")
signedContent := signer("tests/post.json")
signedContent, err := ioutil.ReadFile("tests/post.json")
if err != nil {
fmt.Println("Error reading post.")
}
fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
......@@ -485,7 +488,10 @@ func main() {
w.Header().Set("UID", UID)
w.WriteHeader(http.StatusOK)
fmt.Println("Signing test json.")
signedContent := signer("tests/post.json")
signedContent, err := ioutil.ReadFile("tests/post.json")
if err != nil {
fmt.Println("Error reading file")
}
//fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
......@@ -507,7 +513,10 @@ func main() {
if err != nil {
fmt.Println("Error, user directory empty!")
}
signedContent := signer("tests/users/" + names[0].Name())
signedContent, err := ioutil.ReadFile("tests/users/" + names[0].Name())
if err != nil {
fmt.Println("Error reading file")
}
fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
......@@ -525,7 +534,10 @@ func main() {
//w.Header().Set("Authentication", signature)
w.WriteHeader(http.StatusOK)
fmt.Println("Signing test json.")
signedContent := signer("tests/post.json")
signedContent, err := ioutil.ReadFile("tests/post.json")
if err != nil {
fmt.Println("Error reading file")
}
fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
......@@ -540,13 +552,13 @@ func main() {
signed := req.Header.Get("Signature")
target := req.Header.Get("Target")
// signature := req.Header.Get("Authorization")
signature, err := ioutil.ReadAll(req.Body)
//signature, err := ioutil.ReadAll(req.Body)
fmt.Println(string(signed))
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signature), initializedActors)
//ok := validateLogin(signed, []byte(signature), initializedActors)
ok := true
if ok {
w.Header().Set("Authorization", "ok")
w.WriteHeader(http.StatusOK)
......@@ -570,13 +582,13 @@ func main() {
signed := req.Header.Get("Signature")
target := req.Header.Get("Target")
// signature := req.Header.Get("Authorization")
signature, err := ioutil.ReadAll(req.Body)
// signature, err := ioutil.ReadAll(req.Body)
fmt.Println(string(signed))
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signature), initializedActors)
//ok := validateLogin(signed, []byte(signature), initializedActors)
ok := true
if ok {
w.Header().Set("Authorization", "ok")
w.WriteHeader(http.StatusOK)
......@@ -596,13 +608,13 @@ func main() {
fmt.Println("WHER GOING?")
signed := req.Header.Get("Signature")
// signature := req.Header.Get("Authorization")
signature, err := ioutil.ReadAll(req.Body)
// signature, err := ioutil.ReadAll(req.Body)
fmt.Println(string(signed))
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signature), initializedActors)
// if err != nil {
// fmt.Println(err)
// }
//ok := validateLogin(signed, []byte(signature), initializedActors)
ok := true
if ok {
w.Header().Set("Authorization", "ok")
dir := req.Header.Get("Direction")
......@@ -714,13 +726,14 @@ func main() {
// the trailer.
fmt.Println("I HEAR BORK")
signed := req.Header.Get("Signature")
// signature := req.Header.Get("Authorization")
signature, err := ioutil.ReadAll(req.Body)
// //signature := req.Header.Get("Authorization")
// signature, err := ioutil.ReadAll(req.Body)
fmt.Println(string(signed))
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signature), initializedActors)
// if err != nil {
// fmt.Println(err)
// }
// ok := validateLogin(signed, []byte(//signature), initializedActors)
ok := true
if ok {
w.Header().Set("Authorization", "ok")
w.WriteHeader(http.StatusOK)
......@@ -746,7 +759,7 @@ func main() {
if req.Header.Get("Accept") == "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"" {
fmt.Println("Accept header is correct.")
w.Header().Set("Content-Type", "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"")
//w.Header().Set("Authentication", signature)
//w.Header().Set("Authentication", //signature)
var borks []libs.ActorS
for _, v := range posts {
......@@ -754,7 +767,10 @@ func main() {
}
upBork(borks)
signedContent := signer("tests/borks.json")
signedContent, err := ioutil.ReadFile("tests/borks.json")
if err != nil {
fmt.Println("Error reading file")
}
fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment