[ADD] Added initial data to providers.
authorvta vta@openerp.com <>
Tue, 14 Aug 2012 15:45:29 +0000 (17:45 +0200)
committervta vta@openerp.com <>
Tue, 14 Aug 2012 15:45:29 +0000 (17:45 +0200)
bzr revid: vta@openerp.com-20120814154529-58c60kynpwkckwmc

addons/auth_oauth/__openerp__.py
addons/auth_oauth/oauth_providers.py
addons/auth_oauth/oauth_providers.xml
addons/auth_oauth/oauth_providers_data.xml [new file with mode: 0644]

index 3557bec..e7b47a1 100644 (file)
@@ -30,6 +30,7 @@
     'website': 'http://www.openerp.com',
     'depends': ['base', 'web'],
     'data': [
+        'oauth_providers_data.xml'
     ],
     'update_xml': [
         'oauth_providers.xml'
index 5b5c328..2b42c82 100644 (file)
@@ -12,8 +12,10 @@ class oauth_providers(osv.osv):
         'name' : fields.char('Provider name', required=True),               # Name of the OAuth2 entity, Google, LinkedIn, etc
         'client_id' : fields.char('Client ID', required=True),              # Our identifier
         'auth_endpoint' : fields.char('Authentication URL', required=True), # OAuth provider URL to authenticate users
-        'scope' : fields.char('Accessed user data'),                        # OAUth user data desired to access
+        'scope' : fields.char('Scope'),                                     # OAUth user data desired to access
         'validation_endpoint' : fields.char('Validation URL'),              # OAuth provider URL to validate tokens
+        'data_endpoint' : fields.char('Data URL'),
+        'redirect_uris' : fields.char('Redirect URIs'),
         'icon_url' : fields.char('Icon'),                                   # URL of the icon's provider
         'active' : fields.boolean('Active'),
         'sequence' : fields.integer(),
index 384a305..273ba1c 100644 (file)
@@ -21,6 +21,8 @@
                             <field name="auth_endpoint" />
                             <field name="scope" />
                             <field name="validation_endpoint" />
+                            <field name="data_endpoint" />
+                            <field name="redirect_uris" />
                         </group>
                     </sheet>
                 </form>
diff --git a/addons/auth_oauth/oauth_providers_data.xml b/addons/auth_oauth/oauth_providers_data.xml
new file mode 100644 (file)
index 0000000..b66e6a8
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>        
+<openerp>
+    <data noupdate="1">
+        <record id="1" model="oauth.providers">
+            <field name="name">Google OAuth2</field>
+            <field name="client_id">108010644258-duuhmp6pu7li4tsmnqg7j9rvdeklg0ki.apps.googleusercontent.com</field>
+            <field name="auth_endpoint">https://accounts.google.com/o/oauth2/auth</field>
+            <field name="scope">https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile</field>
+            <field name="validation_endpoint">https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=</field>
+            <field name="data_endpoint">https://www.googleapis.com/oauth2/v1/userinfo?access_token=</field>
+            <field name="redirect_uris">https://localhost/</field>
+            <field name="active">True</field>
+        </record>
+        <record id="2" model="oauth.providers">
+            <field name="name">Twitter OAuth2</field>
+            <field name="client_id">108010644258-duuhmp6pu7li4tsmnqg7j9rvdeklg0ki.apps.twitterusercontent.com</field>
+            <field name="auth_endpoint">https://api.twitter.com/oauth/request_token</field>
+            <field name="scope"></field>
+            <field name="validation_endpoint">https://api.twitter.com/oauth/authorize?oauth_token=</field>
+            <field name="data_endpoint"></field>
+            <field name="redirect_uris">https://localhost/</field>
+            <field name="active">True</field>
+        </record>
+    </data>
+</openerp>
\ No newline at end of file