Commit 8025ed0a authored by Pierre Goubeaux's avatar Pierre Goubeaux
Browse files

Ajout activitypub

parent 1e595a3b
Pipeline #3627 failed with stages
in 55 seconds
......@@ -31,6 +31,8 @@ class ApiModule extends CWebModule
'eco.models.*',
'places.models.*',
'news.models.*',
'dda.models.*',
$this->id.'.models.*',
$this->id.'.components.*',
$this->id.'.messages.*',
......
......@@ -131,6 +131,11 @@ class ApiController extends Controller
"poi"=> array(
"get" => array("href" => "/ph/api/poi/get", "public" => true),
),
"activitypub" => array(
"get" =>array("href" => "/ph/api/activityPub/get","public" =>true),
"actor" =>array("href" => "/ph/api/activityPub/actor","public" =>true),
"finger" =>array("href" => "ph/api/activitypub/finger","public" =>true),
),
);
function initPage(){
......
......@@ -24,6 +24,7 @@ class PersonController extends ApiController {
public function actions(){
return array(
'get' => 'citizenToolKit.controllers.person.GetAction',
'test' => 'citizenToolKit.controllers.ActivityPub.getAction',
'authenticate' => 'citizenToolKit.controllers.person.AuthenticateAction',
'changepassword' => 'citizenToolKit.controllers.person.ChangePasswordAction',
'register' => 'citizenToolKit.controllers.person.RegisterAction',
......
......@@ -46,6 +46,13 @@
"type": "string",
"required": true
},
"activitypub-id": {
"name": "activitypub-id",
"in": "path",
"description": "The activitypub identifier string",
"type": "string",
"required": true
},
"insee": {
"name": "insee",
"in": "query",
......@@ -97,6 +104,67 @@
}
},
"paths": {
"/activitypub/get": {
"get": {
"tags": [
"ActivityPub"
],
"parameters": [
{
"$ref": "#/parameters/insee"
},
{
"$ref": "#/parameters/tags"
},
{
"$ref": "#/parameters/limit"
},
{
"$ref": "#/parameters/index"
}
],
"description": "Get information about all ActivityPub.",
"responses": {
"200": {
"description": "The list on of ActivityPub.",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref":"#/definitions/allActivityPub"
}
}
}
}
}
}
},
"/activitypub/get/id/{activitypub-id}": {
"get": {
"tags": [
"ActivityPub"
],
"parameters": [
{
"$ref": "#/parameters/activitypub-id"
}
],
"description": "Get information about ActivityPub.",
"responses": {
"200": {
"description": "The ActivityPub object",
"schema": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/activitypub"
}
}
}
}
}
}
},
"/person/get": {
"get": {
"tags": [
......@@ -453,6 +521,152 @@
}
}
},
"allActivityPub": {
"type": "object",
"properties": {
"meta": {
"$ref": "#/definitions/meta"
},
"entities": {
"type": "object",
"properties": {
"id": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"description": "Type of element."
},
"name": {
"type": "string",
"description": "Name of user."
},
"url": {
"$ref": "#/definitions/url"
}
}
}
}
}
}
},
"activitypub": {
"type": "object",
"properties": {
"meta": {
"$ref": "#/definitions/meta"
},
"entities": {
"type": "object",
"properties": {
"_id": {
"properties": {
"$id": {
"type": "string",
"description": "Type of id."
}
}
},
"type":{
"type" : "string"
},
"verb":{
"type" : "string"
},
"author": {
"properties": {
"id": {
"type": "string",
"description": "Type of id."
},
"name": {
"type": "string",
"description": "type of the name."
}
}
},
"updated":{
"properties":{
"sec": {
"type": "integer",
"description": "the type of the seconde."
},
"usec": {
"type": "integer",
"description": "type of the usec."
}
}
},
"created":{
"properties": {
"sec":{
"type" : "integer",
"description": "type on secondes."
},
"usec":{
"type": "integer",
"description": "type of the usec."
}
}
},
"target":{
"properties": {
"type": {
"type":"string",
"description": "the type of the target"
},
"id": {
"type": "string",
"description": "the type of the id"
}
}
},
"shared-by": {
"properties": {
"type": {
"type":"string",
"description": "the type of the target"
},
"id": {
"type": "string",
"description": "the type of the id"
},
"updated":{
"properties":{
"sec":{
"type": "integer",
"description": "Type of secondes"
},
"usec":{
"type":"integer",
"description":"Type of the usec"
}
}
}
}
},
"scope":{
"type":"string"
},
"object":{
"properties":{
"displayname":{
"type":"string",
"description":"The type of the name"
},
"displayvalue":{
"type":"string",
"description":"Type of the displayvalue"
}
}
},
"image":{
"type":"string"
}
}
}
}
},
"allPerson": {
"type": "object",
"properties": {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment