26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
|
from openerp.osv import osv, fields
|
||
|
|
||
|
class oauth_providers(osv.osv):
|
||
|
|
||
|
"""Class defining the configuration values of an OAuth2 provider"""
|
||
|
|
||
|
_name = 'oauth.providers'
|
||
|
_description = 'OAuth2 provider'
|
||
|
_order = 'name'
|
||
|
|
||
|
_columns = {
|
||
|
'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
|
||
|
'validation_endpoint' : fields.char('Validation URL'), # OAuth provider URL to validate tokens
|
||
|
'icon_url' : fields.char('Icon'), # URL of the icon's provider
|
||
|
'active' : fields.boolean('Active'),
|
||
|
'sequence' : fields.integer(),
|
||
|
}
|
||
|
|
||
|
_sql_constraints = [
|
||
|
('name', 'unique(name)', 'The name of the OAuth provider must be unique')
|
||
|
]
|
||
|
|
||
|
oauth_providers()
|