Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Website
Commits
9e9ee707
Commit
9e9ee707
authored
Jan 27, 2019
by
Matija Obreza
Browse files
Edit and display allowed CORS origins for OAuth clients
parent
3d02490e
Changes
5
Hide whitespace changes
Inline
Side-by-side
locales/en/translations.json
View file @
9e9ee707
...
...
@@ -2002,6 +2002,8 @@
},
"roleLabel"
:
"User roles"
,
"oAuth"
:
{
"allowedOrigins"
:
"Allowed CORS origins"
,
"autoApproveScopes"
:
"Auto-approved scopes"
,
"clientId"
:
"clientId"
,
"clientTitle"
:
"Title"
,
"accessTokenValidity"
:
"Access token validity"
,
...
...
src/model/oauth/OAuthClient.ts
View file @
9e9ee707
...
...
@@ -30,6 +30,7 @@ class OAuthClient {
public
refreshTokenValidity
:
number
;
public
refreshTokenValiditySeconds
:
number
;
public
registeredRedirectUri
:
string
[];
public
allowedOrigins
:
string
[];
public
resourceIds
:
string
[];
public
roles
:
string
[];
public
scoped
:
boolean
;
...
...
src/user/translations.json
View file @
9e9ee707
...
...
@@ -153,6 +153,8 @@
},
"roleLabel"
:
"User roles"
,
"oAuth"
:
{
"allowedOrigins"
:
"Allowed CORS origins"
,
"autoApproveScopes"
:
"Auto-approved scopes"
,
"clientId"
:
"clientId"
,
"clientTitle"
:
"Title"
,
"accessTokenValidity"
:
"Access token validity"
,
...
...
src/user/ui/admin/c/OAuthClientCard.tsx
View file @
9e9ee707
...
...
@@ -35,6 +35,9 @@ const OAuthClientCard = ({ compact = false, oAuthClient, removeSecretRequest, in
<
div
>
{
oAuthClient
.
description
}
</
div
>
<
div
>
{
oAuthClient
.
allowedOrigins
&&
oAuthClient
.
allowedOrigins
.
map
((
uri
,
i
)
=>
<
span
key
=
{
uri
+
i
}
className
=
"pr-5"
>
{
uri
}
</
span
>)
}
</
div
>
</
CardContent
>
</
Card
>
)
:
(
...
...
@@ -58,6 +61,7 @@ const OAuthClientCard = ({ compact = false, oAuthClient, removeSecretRequest, in
{
oAuthClient
.
registeredRedirectUri
&&
oAuthClient
.
registeredRedirectUri
.
length
>
0
&&
<
PropertiesItem
title
=
{
t
(
'
user.common.oAuth.redirectUris
'
)
}
>
{
oAuthClient
.
registeredRedirectUri
.
map
((
uri
,
i
)
=>
<
div
key
=
{
uri
+
i
}
className
=
"mb-5"
>
{
uri
}
</
div
>)
}
</
PropertiesItem
>
}
<
PropertiesItem
title
=
{
t
(
'
user.common.oAuth.allowedOrigins
'
)
}
>
{
oAuthClient
.
allowedOrigins
&&
oAuthClient
.
allowedOrigins
.
map
((
uri
,
i
)
=>
<
div
key
=
{
uri
+
i
}
className
=
"mb-5"
>
{
uri
}
</
div
>)
}
</
PropertiesItem
>
{
oAuthClient
.
resourceIds
&&
oAuthClient
.
resourceIds
.
length
>
0
&&
<
PropertiesItem
title
=
{
t
(
'
user.common.oAuth.resourceIds
'
)
}
>
{
oAuthClient
.
resourceIds
.
map
((
id
,
i
)
=>
<
div
key
=
{
id
+
i
}
className
=
"mb-5"
>
{
id
}
</
div
>)
}
</
PropertiesItem
>
}
...
...
src/user/ui/admin/c/OAuthClientForm.tsx
View file @
9e9ee707
...
...
@@ -68,6 +68,7 @@ class UserForm extends React.Component<any, any> {
validate
=
{
[
Validators
.
decimalNumber
]
}
/>
<
ItemsEditor
name
=
"registeredRedirectUri"
itemLabel
=
{
t
(
'
user.common.oAuth.redirectUris
'
)
}
addItem
=
{
console
.
log
}
removeItem
=
{
console
.
log
}
component
=
{
stringField
}
/>
<
ItemsEditor
name
=
"allowedOrigins"
itemLabel
=
{
t
(
'
user.common.oAuth.allowedOrigins
'
)
}
addItem
=
{
console
.
log
}
removeItem
=
{
console
.
log
}
component
=
{
stringField
}
/>
<
FieldArray
name
=
"authorizedGrantTypes"
options
=
{
OAuthClient
.
AVAILABLE_GRANT_TYPES
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment