Skip to content

Latest commit

 

History

History
138 lines (129 loc) · 15.7 KB

aigents_integration_news_user.md

File metadata and controls

138 lines (129 loc) · 15.7 KB

Aigents Server Integration for News Aggregation on User basis

https://aigents.com/

1. Security and business requirements

This instructions extends more simple Aigents Server Integration for News Syndication on Channel basis. The following aspects should be kept in mind and taken care of in order to assure legal safety of the integration.

  1. The integration is expected to handle personal data and user authentication data.
    1. Both kinds of data are protected by different national regulations like GDPR so whatever you do in regard to this integration, you have to check in with your laweyr first.
    2. You must conduct all API interactions over HTTPS protocol using valid SSL certificate and using only HTTP POST requests (not HTTP GET requests to call Aigents server).
      1. Free and secure SSL certificates may be updated with Get HTTPS for free.
    3. If you transfer the traffic and data from Aigents server and to it in your system over any other communication media, you must ensure proper encryption of those communication channels.
    4. If you host your own Aigents server your have to take security measures to protect storage of the data on Aigents server location (local files on the file system, including file al.txt primarily) corresponding to legal regulations corresponding to citizenship of your users.
    5. If you store any personal data and user authentication data, including the data obtained from Aigents server and sed to it, you should the same security measures, corresponding to legal regulations corresponding to citizenship of your users, in regard to storage of the data.
    6. The data which has to be covered by security measures includes email, name, surname, date of birth, secret question, secret answer (password) as well as identifiers and tokens in social networks, blockchains and messengers.
    7. If you are making your integration with Aigents Web Demo server at https://aigents.com, your should comply with Aigents Privacy Policy and License Agreement
    8. If you are making your integration with any Aigents server other than https://aigents.com, you may use Aigents Privacy Policy and License Agreement as a template as your own privacy policy and user agreement to be confirmed or signed by your users and make sure that it complies with legal regulations corresponding to citizenship of your users.
    9. If your integration involves transfer of the personal and authentication data of the users over the national boundaries or between different business entities, make sure that your own privacy policy and user agreement make this agreed by users and not conflicting national regulations in the countries that users' are citizens of.
      1. Transfer of such data may be not allowed by legal regulations of some of the countries.
      2. For transfer of the data from one business entity to another may require explicit written agreement on behalf of the user approving this kind of transfer, accordingly to legal regulations of some of the countries.
  2. The integration with some of the social networks and messengers assumes legal business responsibility in respect to your integration of Aigents-based service, so the following should be followed.
    1. Facebook
      1. Facebook integration requires to set-up your own business account, create your Aigents-based Facebook application under this account and get application id and application secret (plus challenge in the case if you want to have a bot integration with Facebook Messenger). In addition, you need the following Facebook permissions granted to your Facebook application, which would require signing official paperwork between your business entity and Facebook.
        1. email and profile - for the authentication purposes.
        2. user_posts - for news aggregation and maintenance of the Aigents News monitoring for your users based on their feeds o Facebook social network.
        3. pages_messaging - for the purpose of integration with Facebook Messenger in order to give your users ability to interact with Aigents server as a chat-bot.
      2. Your application application id and application secret and challenge should be passed to Aigents server as facebook id, facebook key and facebook challenge over secure communication channel.
      3. In the course of your application interactions with Facebook authentication, for every your user granting you with access to their Facebook account, you will need to maintain user id (as facebook id) and long-lived token (facebook token) to pass them to Aigents server over secure communication channel.
    2. Reddit
      1. Reddit integration requires to set-up your own Reddit account, create your Aigents-based Reddit application under this account and get application id and application secret.
      2. Your application application id and application secret should be passed to Aigents server as reddit id and reddit key over secure communication channel.
      3. In the course of your application interactions with Reddit authentication, for every your user granting you with access to their Reddit account, you will need to maintain user id (as reddit id) and refresh token (reddit token) to pass them to Aigents server over secure communication channel.
    3. Telegram
      1. Telegram integration requires to set-up your own Telegram bot, and get bot id and token for it.
      2. Your application bot id and token should be passed to Aigents server as telegram id and telegram token over secure communication channel.
      3. Your users interacting with Telegram will be assigned telegram id which will be stored on side of the Aigents server and made available to your application over integration protocol over secure communication channel.
    4. Slack
      1. Slack integration requires to set-up your own Slack development account, create your Aigents-based Slack application under this account and get application id and application secret. You will also need to get permissions necessary for conventional chat-bot operations.
      2. Your application application id and application secret should be passed to Aigents server as slack id and slack key over secure communication channel.
      3. Your users interacting with Slack will be assigned slack id which will be stored on side of the Aigents server and made available to your application over integration protocol over secure communication channel.

2. Tecnnhical aspects - "what can I do" and "how to do"

The integration based on user (called peer in Aigents) relies on simpler integration based on channels and extends the latter. The simpler channel-based integration assumes only few users are creating customised channels as a channel owners. The more complex user-based integration discussed here assumes that every individual user may create the channel (called area in Aigents) of their own, regardless of whether they like to get news items from the other users or not.

The user-based integration assumes two categories of users involved: administrator user and regular user.

  1. Administrator user should be able to use integration channel to configure Aigents server in respect to the following configuration parameters for each of the social communication platforms (social networks ad messengers) as follows.
    1. The user with administrator role is identified automatically as a first user registered with and logged into the fresh Aigents Server installation.
    2. Any of the following parameters can be set updated with the following statements in AL language.
      1. Get values of any combination of parameters - example:
        1. Say: What your http threads, http timeout?
        2. Get: My http threads 32, http timeout 60000.
      2. Set values for any combination of parameters - example:
        1. Say: Your http threads 32, http timeout 60000.
        2. Get: Ok.
    3. System parameters
      1. Server identification
        1. name
      2. Storage parameters
        1. attention period
        2. retention period
        3. store cycle sec
      3. Email - generic parameters
        1. email login
        2. email password
        3. email cycle sec
        4. email retries
      4. Email - Javax Mail parameters
        1. mail.pop3.starttls.enable <true|false>
        2. mail.pop3s.host
        3. mail.pop3s.port
        4. mail.smtp.auth <true|false>
        5. mail.smtp.host
        6. mail.smtp.port
        7. mail.smtp.ssl.enable <true|false>
        8. mail.smtp.starttls.enable <true|false>
        9. mail.store.protocol pop3
      5. HTTP parameters
        1. http origin
        2. http port
        3. http secure <true|false>
        4. http threads
        5. http timeout
        6. cookie domain
        7. cookie name
      6. TCP/IP parameters - used to connect via sockets or telnet client
        1. tcp port
        2. tcp timeout
    4. Social communication platform integration parameters, having all id, key ad token values taken in single quotes (like saying: Your facebook id '12345', facebook key 'aBcDeFg678900', telegram token '9876wXyZ').
      1. Facebook:
        1. facebook id - application id
        2. facebook key - application secret
        3. facebook challenge - needed for Facebook Messenger bot integration only
      2. Reddit:
        1. reddit id - application id
        2. reddit key - application secret
      3. Telegram:
        1. telegram token - obtanied with Bot Father bot
      4. Slack:
        1. slack id - application id
        2. slack key - application secret
      5. Twitter (TBD):
        1. twitter id - application id
        2. twitter key - application secret
  2. Regular user should be able to perform multiple activities as follows.
    1. Get personalised news feed corresponding to their authenticated account - in the same way as it is described for channel/area owners, including two kinds of relevance measures:
      1. relevance (personal) relevance based on custom user setup and their personal experience with news items;
      2. social relevance based on personal experiences of the other users in the list of trusts, based on their own levels of reputation, earned in the course other users providing feedback to the news items and comments made by the former ones.
    2. Get reputation levels for the list of those users in the system, who have shared their news feeds to the current user, saying: What is peer, friend true, trust true email, reputation? (TBD).
    3. Create (author) news item to stay in their custom feed (and potentially being shared to others) - for the users impersonating WP content managers, saying: There text '', sources '', times , new true, trust true update. (example: There text 'Aigents news feed on Reddit', sources 'https://www.reddit.com/r/aigents', times 2020-01-30, new true, trust true update.).
      1. Note: when entering text containing quotes or double quotes, one of the three policies can be employed:
        1. If text contains only single quotes, it must be framed into double quotes like There text "There's an event", sources 'https://x.com/news/123'.
        2. If text contains only double quotes, it must be framed into single quotes like There text 'They are saying "there is an event"', sources 'https://x.com/news/123'.
        3. If text contains double and single quotes both or i ay of the two cases above, it must be framed into single or double quotes having the internal quotes escaped with backslashes like There text 'They are saying "there's is an event"', sources 'https://x.com/news/123'.
    4. Comment on any news item, authoring comment item saying something like (TBD): There text , times , parents . (example: There text 'That is great news', times 2020-01-31 parents text text 'Aigents news feed on Reddit'.).
    5. Provide positive “binary” (0 or 1) rating (like/vote) feedback for any news item or a comment in their feed, including items authored by other users (if any) or comments on these news items, like follows.
      1. Trust to news item: sources '', text '', times , trust true. (example sources 'https://www.reddit.com/r/aigents', text 'Aigents news feed on Reddit', times 2020-01-30, trust true.)
      2. Do not trust to news item: sources '', text '', times , trust false. (example: sources 'https://www.reddit.com/r/aigents', text 'Aigents news feed on Reddit', times 2020-01-30, trust false.)
    6. Provide ability to remove any news item or a comment from the feed saying: sources '', text '', times , new false. (example: sources 'https://www.reddit.com/r/aigents', text 'Aigents news feed on Reddit', times 2020-01-30, new false.)
    7. Specify a list of users that they like to share their custom news feeds to as public (that is, user A may share their custom news to user B or not, regardless whether B trusts to A or not), like follows.
      1. Make user to receive news from current user: is peer, name , surname email share true.
      2. Make user to not receive news from current user: is peer, name , surname email share false.
    8. Specify a list of users that they trust to read their own custom news feeds shared publicly to others (that is, user B may trust to get custom news from user A or not, regardless whether A shares them or not), like follows:
      1. Trust user to be source of news: is peer, name , surname email trust true.
      2. Do not trust user to be source of news: is peer, name , surname email trust false.
    9. Specify a list of websites (or news sources such as Reddit subreddits or Reddit or Telegram user channels) that user wants to have the news extracted from for their custom feeds, following the Set up channel (area) configuration instructions.
    10. Specify a list of topics (represented as Aigents patterns) that user wants to have the news extracted from for their custom feeds, following the Set up channel (area) configuration instructions.
    11. Specify their ids along with access and refresh tokens for the following social platform integrations, having all id, and token values taken in single quotes (like saying: My facebook id '12345', facebook token '345aBcDeFg678900', telegram id '78567410').
      1. Facebook: id, long lived token - saying My facebook id '', facebook token ''.
      2. Reddit: id, refresh token - saying My reddit id '', reddit token ''.
      3. Telegram: id - saying My telegram id ''
      4. Slack: id - saying My slack id ''
      5. Twitter (TBD): id, long lived or access token

https://aigents.com/