Published:
2024-05-30
When using go-ap/jsonld , to extend the context by a term use:
jsonld.WithContext(
jsonld.Context{
{IRI: jsonld.IRI(vocab.ActivityBaseURI)},
{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
},
)
Instead of:
var ApEncoder = jsonld.WithContext(
jsonld.IRI(vocab.ActivityBaseURI),
jsonld.Context{
{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
},
)
The latter ignores the terms.
#golang #dev #activitypub #fediverse
Published:
2024-05-30
My blog now (hopefully) supports #hashtags on #ActivityPub . Please like this post if you found this via a hashtag.
#testing
Published:
2024-05-30
again testing hashtags with #activitypub #mastodon format.
Published:
2024-05-21
I'm not sure if this note will show up on hashtags. They are added to the #ActivityPub object, but is this sufficient for #Mastodon ?
Please react to this if you saw this note due to its hashtag!
#fediverse #testing
Published:
2024-05-20
owl-blogs now supports replies to entries. The content of the reply is added to the bottom of the post, similar to comments.
#ActivityPub #Fediverse
Published:
2024-05-17
I can now process likes on my blog notes via #ActivityPub
Published:
2024-05-16
Sign message for ActivityPub mock:
Based on Mastodon Doc - Security
def sign(method, url, data):
from urllib.parse import urlparse
from cryptography.hazmat.primitives.serialization import load_pem_private_key
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
priv_key = load_pem_private_key(PRIV_KEY_PEM.encode(), None)
body = json.dumps(data).encode()
body_hash = hashlib.sha256(body).digest()
digest = "SHA-256=" + base64.b64encode(body_hash).decode()
date = datetime.now(tz=timezone.utc).strftime("%a, %d %b %Y %H:%M:%S GMT")
host = "localhost:3000"
target = urlparse(url).path
to_sign = f"""(request-target): {method.lower()} {target}
host: {host}
date: {date}""".encode()
sig = priv_key.sign(
to_sign,
padding.PKCS1v15(),
hashes.SHA256(),
)
sig_str = base64.b64encode(sig).decode()
request = requests.Request(method, url, data=body)
request = request.prepare()
request.headers["Content-Digest"] = digest
request.headers["Host"] = host
request.headers["Date"] = date
request.headers["Signature"] = (
f'keyId="http://mock_masto/users/h4kor#main-key",headers="(request-target) host date",signature="{sig_str}"'
)
return request
Published:
2024-05-10
2027: Das Landgericht Hamburg entscheidet, dass das vorsätzliche falsch beantworten eines CAPTCHA ein schwerer Eingriff in die Verkehrssicherheit ist. Die falschen Trainingsdaten können bei selbstfahrenden Autos zu Unfällen führen.
Der Angeklagte wurde zu einer Freiheitsstrafe von 3 Jahren und einem Schadensersatz von 5 Mio. € an den Kläger Tesla Inc. verurteilt.