Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth2+test #2

Merged
merged 3 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

\.idea/

vendor/

test\.json
37 changes: 37 additions & 0 deletions appinfo/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);


/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\Social\AppInfo;

require_once __DIR__ . '/autoload.php';
require_once(__DIR__ . '/../lib/autoload.php');

//$app = new Application();
//$app->registerNavigation();

38 changes: 38 additions & 0 deletions appinfo/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);


/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/


namespace OCA\Social\AppInfo;

$composerDir = __DIR__ . '/../vendor/';

if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) {
require_once $composerDir . 'autoload.php';
}

119 changes: 119 additions & 0 deletions appinfo/database.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>

<table>
<name>*dbprefix*social_services</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<length>7</length>
<unsigned>true</unsigned>
<notnull>true</notnull>
<autoincrement>true</autoincrement>
<primary>true</primary>
</field>

<field>
<name>type</name>
<type>text</type>
<length>15</length>
</field>

<field>
<name>address</name>
<type>text</type>
<length>128</length>
</field>

<field>
<name>config</name>
<type>text</type>
<length>3000</length>
</field>

<field>
<name>status</name>
<type>integer</type>
<length>1</length>
</field>

<field>
<name>creation</name>
<type>timestamp</type>
</field>

</declaration>
</table>

<table>
<name>*dbprefix*social_accounts</name>
<declaration>

<field>
<name>id</name>
<type>integer</type>
<length>7</length>
<unsigned>true</unsigned>
<notnull>true</notnull>
<autoincrement>true</autoincrement>
<primary>true</primary>
</field>

<field>
<name>service_id</name>
<type>integer</type>
<length>7</length>
<notnull>true</notnull>
</field>

<field>
<name>user_id</name>
<type>text</type>
<length>63</length>
</field>

<field>
<name>account</name>
<type>text</type>
<length>127</length>
</field>

<field>
<name>account_id</name>
<type>integer</type>
<length>7</length>
</field>

<field>
<name>status</name>
<type>integer</type>
<length>1</length>
</field>

<field>
<name>auth</name>
<type>text</type>
<length>2000</length>
</field>

<field>
<name>config</name>
<type>text</type>
<length>2000</length>
</field>

<field>
<name>creation</name>
<type>timestamp</type>
</field>

</declaration>
</table>

</database>

49 changes: 27 additions & 22 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>social</id>
<name>Social</name>
<summary>🎉 Nextcloud becomes part of the federated social networks!</summary>
<description><![CDATA[test]]></description>
<version>0.0.1</version>
<licence>agpl</licence>
<author mail="jus@bitgrid.net" >Julius Härtl</author>
<author mail="hey@jancborchardt.net" homepage="https://jancborchardt.net">Jan-Christoph Borchardt</author>
<namespace>Social</namespace>
<category>social</category>
<bugs>https://github.com/nextcloud/social</bugs>
<dependencies>
<nextcloud min-version="14" max-version="15"/>
</dependencies>
<navigations>
<navigation>
<name>Social</name>
<route>social.page.index</route>
</navigation>
</navigations>
<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>social</id>
<name>Social</name>
<summary>🎉 Nextcloud becomes part of the federated social networks!</summary>
<description><![CDATA[test]]></description>
<version>0.0.10</version>
<licence>agpl</licence>
<author mail="maxence@artificial-owl.com">Maxence Lange</author>
<author mail="jus@bitgrid.net">Julius Härtl</author>
<author mail="hey@jancborchardt.net" homepage="https://jancborchardt.net">Jan-Christoph Borchardt</author>
<namespace>Social</namespace>
<category>social</category>
<website>https://github.com/nextcloud/social</website>
<repository type="git">https://github.com/nextcloud/social.git</repository>
<bugs>https://github.com/nextcloud/social/issues</bugs>
<screenshot>https://raw.githubusercontent.com/nextcloud/social/master/screenshots/screenshot.png</screenshot>
<dependencies>
<nextcloud min-version="14" max-version="15"/>
</dependencies>
<navigations>
<navigation>
<name>Social</name>
<route>social.Navigation.navigate</route>
</navigation>
</navigations>

</info>
37 changes: 33 additions & 4 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,37 @@
* it's instantiated in there
*/
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#mail', 'url' => '/mail', 'verb' => 'GET'],
]
'routes' => [
['name' => 'Navigation#navigate', 'url' => '/', 'verb' => 'GET'],

[
'name' => 'ServiceAccounts#getAvailableAccounts', 'url' => '/user/accounts',
'verb' => 'GET'
],
[
'name' => 'ServiceAccounts#create', 'url' => '/user/account',
'verb' => 'POST'
],
[
'name' => 'ActivityStreams#test', 'url' => '/user/account/{accountId}/test',
'verb' => 'GET'
],
[
'name' => 'ActivityStreams#statuses', 'url' => '/user/account/{accountId}/statuses',
'verb' => 'GET'
],
[
'name' => 'ActivityStreams#follows', 'url' => '/user/account/{accountId}/follows',
'verb' => 'GET'
],

// [
// 'name' => 'OAuth2#getAuthUrl', 'url' => '/client/oauth2/auth/{serviceId}/',
// 'verb' => 'GET'
// ],
[
'name' => 'OAuth2#setCode', 'url' => '/client/oauth2/redirect/{serviceId}/',
'verb' => 'GET'
]
]
];
16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "vendor_name/package_name",
"description": "description_text",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [
{
"name": "author's name",
"email": "email@example.com"
}
],
"require": {
"league/oauth2-client": "2.3.0",
"lrf141/oauth2-mastodon": "1.0.1"
}
}
Loading