<?php // $file = /home/bluedoor/www/dev/wp-content/plugins/yooessentials/modules/auth/drivers/Twitter/driver.json

return [
  'type' => 'oauth', 
  'name' => 'twitter', 
  'title' => 'Twitter', 
  'description' => 'Twitter OAuth authentication', 
  'services' => ['Twitter'], 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/auth/drivers/Twitter/icon.svg', $file), 
  'endpoints' => [
    'oauth' => 'https://oauth.zoolanders.com/twitter', 
    'presave' => 'yooessentials/auth/twitter', 
    'poll' => 'https://oauth.zoolanders.com/twitter/poll'
  ], 
  'poll' => true, 
  'scopes' => [
    'users.read' => 'Public Profile', 
    'tweet.read' => 'Read Tweets', 
    'offline.access' => 'Continuous Access'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'Optional name to identify this auth.'
    ], 
    '_scopes' => [
      'label' => 'Scopes', 
      'type' => 'yooessentials-oauth-scopes', 
      'description' => 'The scopes this auth has access to.'
    ], 
    '_custom' => [
      'type' => 'fields', 
      'fields' => [
        'clientId' => [
          'label' => 'OAuth Client ID', 
          'description' => 'The public identifier of the app.', 
          'encrypt' => true
        ], 
        'clientSecret' => [
          'label' => 'OAuth Client secret', 
          'description' => 'The secret known only to the application and the authorization server.', 
          'encrypt' => true
        ], 
        'refreshToken' => [
          'label' => 'Refresh Token', 
          'description' => 'The token that will allows us to obtain and refresh an Access Token.', 
          'encrypt' => true
        ]
      ]
    ]
  ]
];
