mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-26 12:01:08 +00:00
introduce nodeinfo
This commit is contained in:
parent
587bd07372
commit
8116214727
6 changed files with 238 additions and 163 deletions
|
|
@ -65,18 +65,6 @@ func TestActorIdValidation(t *testing.T) {
|
|||
t.Errorf("validation error expected but was: %v\n", sut.Validate())
|
||||
}
|
||||
|
||||
sut = ActorID{}
|
||||
sut.ID = "1"
|
||||
sut.Source = "forgejox"
|
||||
sut.Schema = "https"
|
||||
sut.Path = "api/v1/activitypub/user-id"
|
||||
sut.Host = "an.other.host"
|
||||
sut.Port = ""
|
||||
sut.UnvalidatedInput = "https://an.other.host/api/v1/activitypub/user-id/1"
|
||||
if sut.Validate()[0] != "Value forgejox is not contained in allowed values [[forgejo gitea]]" {
|
||||
t.Errorf("validation error expected but was: %v\n", sut.Validate())
|
||||
}
|
||||
|
||||
sut = ActorID{}
|
||||
sut.ID = "1"
|
||||
sut.Source = "forgejo"
|
||||
|
|
@ -102,6 +90,18 @@ func TestPersonIdValidation(t *testing.T) {
|
|||
if _, err := IsValid(sut); err.Error() != "path: \"path\" has to be a person specific api path" {
|
||||
t.Errorf("validation error expected but was: %v\n", err)
|
||||
}
|
||||
|
||||
sut = PersonID{}
|
||||
sut.ID = "1"
|
||||
sut.Source = "forgejox"
|
||||
sut.Schema = "https"
|
||||
sut.Path = "api/v1/activitypub/user-id"
|
||||
sut.Host = "an.other.host"
|
||||
sut.Port = ""
|
||||
sut.UnvalidatedInput = "https://an.other.host/api/v1/activitypub/user-id/1"
|
||||
if sut.Validate()[0] != "Value forgejox is not contained in allowed values [[forgejo gitea]]" {
|
||||
t.Errorf("validation error expected but was: %v\n", sut.Validate())
|
||||
}
|
||||
}
|
||||
|
||||
func TestWebfingerId(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue