mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 19:26:09 +01:00
choose a not local avail federated userid
This commit is contained in:
parent
a9c00d49da
commit
307b27bbaa
|
@ -91,7 +91,7 @@ func TestActivityPubRepositoryInboxValid(t *testing.T) {
|
||||||
`"openRegistrations":true,"usage":{"users":{"total":14,"activeHalfyear":2}},"metadata":{}}`)
|
`"openRegistrations":true,"usage":{"users":{"total":14,"activeHalfyear":2}},"metadata":{}}`)
|
||||||
fmt.Fprint(res, responseBody)
|
fmt.Fprint(res, responseBody)
|
||||||
})
|
})
|
||||||
federatedRoutes.HandleFunc("/api/v1/activitypub/user-id/2",
|
federatedRoutes.HandleFunc("/api/v1/activitypub/user-id/15",
|
||||||
func(res http.ResponseWriter, req *http.Request) {
|
func(res http.ResponseWriter, req *http.Request) {
|
||||||
// curl -H "Accept: application/json" https://federated-repo.prod.meissa.de/api/v1/activitypub/user-id/2
|
// curl -H "Accept: application/json" https://federated-repo.prod.meissa.de/api/v1/activitypub/user-id/2
|
||||||
responseBody := fmt.Sprintf(`{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],` +
|
responseBody := fmt.Sprintf(`{"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1"],` +
|
||||||
|
@ -132,7 +132,7 @@ func TestActivityPubRepositoryInboxValid(t *testing.T) {
|
||||||
activity := []byte(fmt.Sprintf(
|
activity := []byte(fmt.Sprintf(
|
||||||
`{"type":"Like",`+
|
`{"type":"Like",`+
|
||||||
`"startTime":"%s",`+
|
`"startTime":"%s",`+
|
||||||
`"actor":"%s/api/v1/activitypub/user-id/2",`+
|
`"actor":"%s/api/v1/activitypub/user-id/15",`+
|
||||||
`"object":"%s/api/v1/activitypub/repository-id/%v"}`,
|
`"object":"%s/api/v1/activitypub/repository-id/%v"}`,
|
||||||
time.Now().UTC().Format(time.RFC3339),
|
time.Now().UTC().Format(time.RFC3339),
|
||||||
federatedSrv.URL, srv.URL, repositoryID))
|
federatedSrv.URL, srv.URL, repositoryID))
|
||||||
|
@ -143,7 +143,7 @@ func TestActivityPubRepositoryInboxValid(t *testing.T) {
|
||||||
assert.Equal(t, http.StatusNoContent, resp.StatusCode)
|
assert.Equal(t, http.StatusNoContent, resp.StatusCode)
|
||||||
|
|
||||||
federationHost := unittest.AssertExistsAndLoadBean(t, &forgefed.FederationHost{HostFqdn: "127.0.0.1"})
|
federationHost := unittest.AssertExistsAndLoadBean(t, &forgefed.FederationHost{HostFqdn: "127.0.0.1"})
|
||||||
federatedUser := unittest.AssertExistsAndLoadBean(t, &user.FederatedUser{ExternalID: "2", FederationHostID: federationHost.ID})
|
federatedUser := unittest.AssertExistsAndLoadBean(t, &user.FederatedUser{ExternalID: "15", FederationHostID: federationHost.ID})
|
||||||
unittest.AssertExistsAndLoadBean(t, &user.User{ID: federatedUser.UserID})
|
unittest.AssertExistsAndLoadBean(t, &user.User{ID: federatedUser.UserID})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue