Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Comunitats Energètiques
Odoo CE
Commits
4f761a56
Commit
4f761a56
authored
2 years ago
by
Daniil Digtyar Vasilieva
Browse files
Options
Downloads
Patches
Plain Diff
Fix root_endpoint and onchange urls
parent
eb921f2f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!86
Fix partners company
,
!72
14 fix endpoint profile
Pipeline
#22175
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
energy_communities/models/auth_oauth_provider.py
+8
-9
8 additions, 9 deletions
energy_communities/models/auth_oauth_provider.py
with
8 additions
and
9 deletions
energy_communities/models/auth_oauth_provider.py
+
8
−
9
View file @
4f761a56
...
...
@@ -3,11 +3,11 @@ from odoo.exceptions import UserError
import
werkzeug
from
odoo.addons.auth_oauth.controllers.main
import
OAuthLogin
as
OAL
URL_ADMIN_USERS
=
"
{root_endpoint}
/auth/
admin/realms/{realm_name}/users
"
URL_AUTH
=
"
{root_endpoint}
/auth/
realms/{realm_name}/protocol/openid-connect/auth
"
URL_VALIDATION
=
"
{root_endpoint}
/auth/
realms/{realm_name}/protocol/openid-connect/userinfo
"
URL_TOKEN
=
"
{root_endpoint}
/auth/
realms/{realm_name}/protocol/openid-connect/token
"
URL_JWKS
=
"
{root_endpoint}
/auth/
realms/{realm_name}/protocol/openid-connect/certs
"
URL_ADMIN_USERS
=
"
{root_endpoint}admin/realms/{realm_name}/users
"
URL_AUTH
=
"
{root_endpoint}realms/{realm_name}/protocol/openid-connect/auth
"
URL_VALIDATION
=
"
{root_endpoint}realms/{realm_name}/protocol/openid-connect/userinfo
"
URL_TOKEN
=
"
{root_endpoint}realms/{realm_name}/protocol/openid-connect/token
"
URL_JWKS
=
"
{root_endpoint}realms/{realm_name}/protocol/openid-connect/certs
"
class
OAuthProvider
(
models
.
Model
):
...
...
@@ -20,8 +20,7 @@ class OAuthProvider(models.Model):
superuser_pwd
=
fields
.
Char
(
string
=
'
Superuser password
'
,
help
=
'"
Superuser
"
user password
'
,
placeholder
=
'
I hope is not
"
admin
"'
,
required
=
False
)
admin_user_endpoint
=
fields
.
Char
(
string
=
'
User admin URL
'
,
required
=
True
)
root_endpoint
=
fields
.
Char
(
string
=
'
Root URL
'
,
required
=
True
,
default
=
'
http://odoo-ce.local:8069
'
)
root_endpoint
=
fields
.
Char
(
string
=
'
Root URL
'
,
required
=
True
,
default
=
'
http://keycloak-ccee.local:8080/auth/
'
)
realm_name
=
fields
.
Char
(
string
=
'
Realm name
'
,
required
=
True
,
default
=
'
0
'
)
def
validate_admin_provider
(
self
):
...
...
@@ -60,6 +59,6 @@ class OAuthProvider(models.Model):
def
get_auth_link
(
self
):
self
.
ensure_one
()
provider_dict
=
[
p_dict
for
p_dict
in
OAL
().
list_providers
()
if
p_dict
.
get
(
'
id
'
)
and
p_dict
.
get
(
'
id
'
)
==
self
.
id
]
provider_dict
=
[
p_dict
for
p_dict
in
OAL
().
list_providers
()
if
p_dict
.
get
(
'
id
'
)
and
p_dict
.
get
(
'
id
'
)
==
self
.
id
]
return
provider_dict
and
provider_dict
[
0
]
and
provider_dict
[
0
][
'
auth_link
'
]
or
''
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment