add first forge actor

This commit is contained in:
Michael Jerger 2023-08-07 09:23:59 +02:00
parent 09e677c722
commit fd91f3aa80
5 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,14 @@
(ns org.domaindrivenarchitecture.fed-poc.forge
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.fed-poc.xsd :as xsd]
[org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]))
;https://forgefed.org/ns#Repository
;TODO: definition in progress
(s/def ::Repository
(s/and
::as/Object
(sh/map-spec (s/keys :opt []))))

View file

@ -0,0 +1,7 @@
(ns org.domaindrivenarchitecture.fed-poc.security
(:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]
[org.domaindrivenarchitecture.fed-poc.owl :as owl]
[org.domaindrivenarchitecture.fed-poc.xsd :as xsd]))

View file

@ -0,0 +1,51 @@
{
"@context": {
"id": "@id",
"type": "@type",
"dc": "http://purl.org/dc/terms/",
"sec": "https://w3id.org/security#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"EcdsaKoblitzSignature2016": "sec:EcdsaKoblitzSignature2016",
"Ed25519Signature2018": "sec:Ed25519Signature2018",
"EncryptedMessage": "sec:EncryptedMessage",
"GraphSignature2012": "sec:GraphSignature2012",
"LinkedDataSignature2015": "sec:LinkedDataSignature2015",
"LinkedDataSignature2016": "sec:LinkedDataSignature2016",
"CryptographicKey": "sec:Key",
"authenticationTag": "sec:authenticationTag",
"canonicalizationAlgorithm": "sec:canonicalizationAlgorithm",
"cipherAlgorithm": "sec:cipherAlgorithm",
"cipherData": "sec:cipherData",
"cipherKey": "sec:cipherKey",
"created": {"@id": "dc:created", "@type": "xsd:dateTime"},
"creator": {"@id": "dc:creator", "@type": "@id"},
"digestAlgorithm": "sec:digestAlgorithm",
"digestValue": "sec:digestValue",
"domain": "sec:domain",
"encryptionKey": "sec:encryptionKey",
"expiration": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
"expires": {"@id": "sec:expiration", "@type": "xsd:dateTime"},
"initializationVector": "sec:initializationVector",
"iterationCount": "sec:iterationCount",
"nonce": "sec:nonce",
"normalizationAlgorithm": "sec:normalizationAlgorithm",
"owner": {"@id": "sec:owner", "@type": "@id"},
"password": "sec:password",
"privateKey": {"@id": "sec:privateKey", "@type": "@id"},
"privateKeyPem": "sec:privateKeyPem",
"publicKey": {"@id": "sec:publicKey", "@type": "@id"},
"publicKeyBase58": "sec:publicKeyBase58",
"publicKeyPem": "sec:publicKeyPem",
"publicKeyWif": "sec:publicKeyWif",
"publicKeyService": {"@id": "sec:publicKeyService", "@type": "@id"},
"revoked": {"@id": "sec:revoked", "@type": "xsd:dateTime"},
"salt": "sec:salt",
"signature": "sec:signature",
"signatureAlgorithm": "sec:signingAlgorithm",
"signatureValue": "sec:signatureValue"
}
}

View file

@ -0,0 +1,21 @@
(ns org.domaindrivenarchitecture.fed-poc.forge-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.fed-poc.security :as sec]
[org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]
[org.domaindrivenarchitecture.fed-poc.forge :as sut]))
(deftest Repository-test
(is (s/valid? ::sut/Repository
{::as/id "https://dev.example/aviva/treesim",
::as/type "Repository",
:sec/publicKey {::sec/id "https://dev.example/aviva/treesim#main-key",
::sec/owner "https://dev.example/aviva/treesim",
::sec/publicKeyPem "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhki....."},
::sut/inbox "https://dev.example/aviva/treesim/inbox",
::sut/outbox "https://dev.example/aviva/treesim/outbox",
::sut/followers "https://dev.example/aviva/treesim/followers",
::sut/team "https://dev.example/aviva/treesim/team",
::sut/name "Tree Growth 3D Simulation",
::sut/summary "<p>Tree growth 3D simulator for my nature exploration game</p>"})))

View file

@ -0,0 +1,8 @@
(ns org.domaindrivenarchitecture.fed-poc.security-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.fed-poc.security :as sut]))
(deftest Repository-test
(is true))