OAuth Provider
oauth_provider · OCA/server-tools
Health
25/100
poor
-
Security5/252 grave, 0 minor
-
Activity0/25Last human commit 86 months ago
-
Required by15/251 module depends on it
-
Maturity5/25In 1 Odoo series since 9.0
Heuristic over the facts below, not an audit · How it's computed
Required by
1
Modules depending on it
External deps
1 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
1.55 MB
Module directory on disk
Code analysis
21 migration notes
6 models
8 views
7 HTTP endpoints
Security warnings
oauth_provider_client_all_users— ACL grants read on 'oauth.provider.client' to every user (portal/public included), and its credential fields (secret) have no `groups=`: those users can read them over RPC. Restrict the fields with `groups=` or drop the grant. CWE-200. acl-public-read-secret · sourceoauth_provider_token_all_users— ACL grants read on 'oauth.provider.token' to every user (portal/public included), and its credential fields (refresh_token, token) have no `groups=`: those users can read them over RPC. Restrict the fields with `groups=` or drop the grant. CWE-200. acl-public-read-secret · source
Found by automated static analysis: these patterns are usually risky, but only a manual review of the module can confirm a real issue. Methodology
Migration considerations
- Migrating to 19.0: only `__manifest__.py` is recognized: a module with `__openerp__.py` is not detected at all. migration-openerp-manifest · source
OAuthProviderAuthorizationCode— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceOAuthProviderClient— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceOAuthProviderClient— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (3 methods) migration-api-multi-one · sourceOAuthProviderScope— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceOAuthProviderScope— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (1 methods) migration-api-multi-one · sourceOAuthProviderToken— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceOAuthProviderToken— Migrating to 13.0: `@api.multi`/`@api.one` were removed (multi is the default): drop them, looping over `self` where `@api.one` was used. (3 methods) migration-api-multi-one · sourceResUsers— Migrating to 19.0: `_sql_constraints` is ignored and its constraints are silently not created: declare `models.Constraint` attributes instead. migration-sql-constraints · sourceview_oauth_provider_client_form— Migrating to 17.0: `attrs=`/`states=` are rejected in views: convert them to Python expressions in `invisible`/`readonly`/`required`, keeping the original AND/OR logic. migration-view-attrs-states · sourceview_oauth_provider_client_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · sourceview_oauth_provider_scope_tree— Migrating to 18.0: the `tree` view type was renamed to `list` (`<list>` roots, `view_mode`). migration-view-tree-tag · source- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `UPDATE res_users SET oauth_identifier = %s WHERE id = %s` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) (2 occurrences in this file) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
- Migrating to 10.0: the `openerp` namespace was renamed to `odoo`; only a deprecated `openerp.addons` alias remained. (`openerp`) migration-openerp-import · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
Dependencies
- Odoo dependencies
-
odoo/odoo:- base
- Python dependencies
- oauthlib
- System dependencies
- None
- Required by
- oauth_provider_jwt
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 8
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
oauth_provider.authorization |
OAuth Authorization Error | ir.ui.view | qweb | New |
oauth_provider.authorization_error |
OAuth Authorization Error | ir.ui.view | qweb | New |
view_oauth_provider_client_form |
oauth.provider.client.form | oauth.provider.client | form | New |
view_oauth_provider_client_search |
oauth.provider.client.search | oauth.provider.client | search | New |
view_oauth_provider_client_tree |
oauth.provider.client.tree | oauth.provider.client | tree | New |
view_oauth_provider_scope_form |
oauth.provider.scope.form | oauth.provider.scope | form | New |
view_oauth_provider_scope_search |
oauth.provider.scope.search | oauth.provider.scope | search | New |
view_oauth_provider_scope_tree |
oauth.provider.scope.tree | oauth.provider.scope | tree | New |
HTTP endpoints 7
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/oauth2/authorize |
OAuth2ProviderController.authorize |
user | http | GET | |
/oauth2/authorize |
OAuth2ProviderController.authorize_post |
user | http | POST | |
/oauth2/otherinfo |
OAuth2ProviderController.otherinfo |
none | http | GET | |
/oauth2/revoke_token |
OAuth2ProviderController.revoke_token |
none | http | POST | |
/oauth2/token |
OAuth2ProviderController.token |
none | http | POST | csrf off sudo |
/oauth2/tokeninfo |
OAuth2ProviderController.tokeninfo |
none | http | GET | |
/oauth2/userinfo |
OAuth2ProviderController.userinfo |
none | http | GET |
Models touched 6
New fields (6)
-
activeBooleandefault=Truehelp='When unchecked, the code is invalidated.' -
client_idMany2one → oauth.provider.clientcomodel_name='oauth.provider.client'help='Client associated to this authorization code.'required=Truestring='Client' -
codeCharhelp='Name of the authorization code.'required=True -
redirect_uri_idMany2one → oauth.provider.redirect.uricomodel_name='oauth.provider.redirect.uri'help='Redirect URI associated to this authorization code.'required=Truestring='Redirect URI' -
scope_idsMany2many → oauth.provider.scopecomodel_name='oauth.provider.scope'help='Scopes allowed by this authorization code.'string='Scopes' -
user_idMany2one → res.userscomodel_name='res.users'help='User associated to this authorization code.'required=Truestring='User'
No public methods.
New fields (10)
-
application_typeSelectiondefault='web application'help='Application type to be used with this client.'required=Trueselection=[('web application', 'Web Application'), ('mobile application', 'Mobile Application'), ('legacy application', 'Legacy Application'), ('backend application', 'Backend Application (not implemented)')] -
grant_typeSelectioncompute='_compute_grant_response_type'help='Grant type used by the client for OAuth.'selection=[('authorization_code', 'Authorization Code'), ('implicit', 'Implicit'), ('password', 'Password'), ('client_credentials', 'Client Credentials')]store=Truestring='OAuth Grant Type' -
identifierCharcopy=Falsedefault=<expr>help='Unique identifier of the client.'readonly=Truerequired=Truestring='Client Identifier' -
nameCharhelp='Name of this client.'required=True -
redirect_uri_idsOne2many → oauth.provider.redirect.uricomodel_name='oauth.provider.redirect.uri'help='Allowed redirect URIs for the client.'inverse_name='client_id'string='OAuth Redirect URIs' -
response_typeSelectioncompute='_compute_grant_response_type'help='Response type used by the client for OAuth.'selection=[('code', 'Authorization Code'), ('token', 'Token'), ('none', 'None')]store=Truestring='OAuth Response Type' -
scope_idsMany2many → oauth.provider.scopecomodel_name='oauth.provider.scope'help='List of scopes the client is allowed to access.'string='Allowed Scopes' -
secretCharhelp='Optional secret used to authenticate the client.' -
skip_authorizationBooleanhelp="Check this box if the user shouldn't be prompted to authorize or not the requested scopes." -
token_typeSelectiondefault='random'help='Type of token to return. The base module only provides randomly generated tokens.'required=Trueselection=[('random', 'Randomly generated')]
-
application_type_mapping(self)@api.model -
generate_user_id(self, user)@api.multiGenerates a unique user identifier for this client Include the client and user identifiers in the final identifier to generate a different identifier for the same user, depending on the client accessing this user. By doing this, clients cannot find a list of common users by comparing their identifiers list from tokeninfo. -
get_oauth2_server(self, validator=None, **kwargs)@api.multiReturns an OAuth2 server instance, depending on the client application type Generates an OdooValidator instance if no custom validator is defined All other arguments are directly passed to the server constructor (for example, a token generator function)
New fields (3)
-
client_idMany2one → oauth.provider.clientcomodel_name='oauth.provider.client'help='Client allowed to redirect using this URI.'required=Truestring='Client' -
nameCharhelp='URI of the redirect.'required=True -
sequenceIntegerdefault=10help='Order of the redirect URIs.'required=True
No public methods.
New fields (7)
-
codeCharhelp='Code of the scope, used in OAuth requests.'required=True -
descriptionTexthelp='Description of the scope, displayed to the user.'required=Truetranslate=True -
field_idsMany2many → ir.model.fieldscomodel_name='ir.model.fields'domain="[('model_id', '=', model_id)]"help='Fields allowed by this scope.'string='Fields' -
filter_idMany2one → ir.filterscomodel_name='ir.filters'domain="[('model_id', '=', model)]"help='Filter applied to retrieve records allowed by this scope.'string='Filter' -
modelCharhelp='Name of the model allowed to be accessed by this scope.'readonly=Truerelated='model_id.model'string='Model Name' -
model_idMany2one → ir.modelcomodel_name='ir.model'help='Model allowed to be accessed by this scope.'required=Truestring='Model' -
nameCharhelp='Name of the scope, displayed to the user.'required=Truetranslate=True
-
get_data_for_model(self, model, res_id=None, all_scopes_match=False)@api.multiReturn the data matching the scopes from the requested model
New fields (8)
-
activeBooleancompute='_compute_active'help='A token is active only if it has not yet expired.'search='_search_active' -
client_idMany2one → oauth.provider.clientcomodel_name='oauth.provider.client'help='Client associated to this token.'required=Truestring='Client' -
expires_atDatetimehelp='Expiration time of the token.'required=True -
refresh_tokenCharhelp='The refresh token, if applicable.' -
scope_idsMany2many → oauth.provider.scopecomodel_name='oauth.provider.scope'help='Scopes allowed by this token.'string='Scopes' -
tokenCharhelp='The token itself.'required=True -
token_typeSelectiondefault='Bearer'help='Type of token stored. Currently, only the bearer token type is available.'required=Trueselection=[('Bearer', 'Bearer')] -
user_idMany2one → res.userscomodel_name='res.users'help='User associated to this token.'required=Truestring='User'
-
generate_user_id(self)@api.multiGenerates a unique user identifier for this token -
get_data_for_model(self, model, res_id=None, all_scopes_match=False)@api.multiReturns the data of the accessible records of the requested model, Data are returned depending on the allowed scopes for the token If the all_scopes_match argument is set to True, return only records allowed by all token's scopes
New fields (1)
-
oauth_identifierCharcopy=Falsedefault=<expr>help='String used to identify this user during an OAuth session.'readonly=Truerequired=Truestring='OAuth Identifier'
No public methods.
Loading…