Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13783280
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/activitystreams/person.go b/activitystreams/person.go
index 4cd1a21..73f95d0 100644
--- a/activitystreams/person.go
+++ b/activitystreams/person.go
@@ -1,34 +1,43 @@
package activitystreams
type Person struct {
BaseObject
Inbox string `json:"inbox"`
Outbox string `json:"outbox"`
PreferredUsername string `json:"preferredUsername"`
URL string `json:"url"`
Name string `json:"name"`
Icon Image `json:"icon"`
Following string `json:"following"`
Followers string `json:"followers"`
Summary string `json:"summary"`
PublicKey PublicKey `json:"publicKey"`
}
func NewPerson(accountRoot string) *Person {
p := Person{
BaseObject: BaseObject{
Type: "Person",
Context: []string{
"https://www.w3.org/ns/activitystreams",
},
ID: accountRoot,
},
URL: accountRoot,
Following: accountRoot + "/following",
Followers: accountRoot + "/followers",
Inbox: accountRoot + "/inbox",
Outbox: accountRoot + "/outbox",
}
return &p
}
+
+func (p *Person) AddPubKey(k []byte) {
+ p.Context = append(p.Context, "https://w3id.org/security/v1")
+ p.PublicKey = PublicKey{
+ ID: p.ID + "#main-key",
+ Owner: p.ID,
+ PublicKeyPEM: string(k),
+ }
+}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jan 31, 8:07 AM (9 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3612099
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment