Skip to content

Commit b24f755

Browse files
committed
fix: resolve comments
1 parent ac129cb commit b24f755

File tree

4 files changed

+125
-39
lines changed

4 files changed

+125
-39
lines changed

admin-ui/configApiSpecs.yaml

+111-12
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,71 @@ paths:
514514
security:
515515
- oauth2:
516516
- 'https://jans.io/oauth/config/agama.readonly'
517+
/api/v1/agama-repo/download:
518+
get:
519+
tags:
520+
- Agama
521+
summary: Download agama project.
522+
description: Download agama project.
523+
operationId: get-agama-project
524+
parameters:
525+
- name: downloadLink
526+
in: query
527+
description: Agama project download Link
528+
schema:
529+
type: string
530+
responses:
531+
'200':
532+
description: Agama project
533+
content:
534+
application/json:
535+
schema:
536+
type: string
537+
format: binary
538+
'204':
539+
description: No Content
540+
'401':
541+
description: Unauthorized
542+
'404':
543+
description: Not Found
544+
'500':
545+
description: InternalServerError
546+
security:
547+
- oauth2:
548+
- 'https://jans.io/oauth/config/agama-repo.readonly'
549+
- 'https://jans.io/oauth/config/agama-repo.write'
550+
- 'https://jans.io/oauth/config/read-all'
551+
/api/v1/agama-repo:
552+
get:
553+
tags:
554+
- Agama
555+
summary: Gets all agama repositories.
556+
description: Gets all agama repositories.
557+
operationId: get-agama-repositories
558+
responses:
559+
'200':
560+
description: Agama repositories
561+
content:
562+
application/json:
563+
schema:
564+
$ref: '#/components/schemas/JsonNode'
565+
examples:
566+
Response json example:
567+
description: Response json example
568+
value: ''
569+
'204':
570+
description: No Content
571+
'401':
572+
description: Unauthorized
573+
'404':
574+
description: Not Found
575+
'500':
576+
description: InternalServerError
577+
security:
578+
- oauth2:
579+
- 'https://jans.io/oauth/config/agama-repo.readonly'
580+
- 'https://jans.io/oauth/config/agama-repo.write'
581+
- 'https://jans.io/oauth/config/read-all'
517582
'/api/v1/agama/syntax-check/{qname}':
518583
post:
519584
tags:
@@ -4631,6 +4696,7 @@ paths:
46314696
- uma_rpt_claims
46324697
- uma_claims_gathering
46334698
- access_evaluation
4699+
- access_evaluation_discovery
46344700
- consent_gathering
46354701
- dynamic_scope
46364702
- spontaneous_scope
@@ -13520,20 +13586,22 @@ components:
1352013586
$ref: '#/components/schemas/AttributeValidation'
1352113587
tooltip:
1352213588
type: string
13589+
selected:
13590+
type: boolean
1352313591
whitePagesCanView:
1352413592
type: boolean
1352513593
userCanView:
1352613594
type: boolean
13527-
adminCanEdit:
13528-
type: boolean
1352913595
userCanEdit:
1353013596
type: boolean
13531-
adminCanView:
13532-
type: boolean
1353313597
userCanAccess:
1353413598
type: boolean
1353513599
adminCanAccess:
1353613600
type: boolean
13601+
adminCanEdit:
13602+
type: boolean
13603+
adminCanView:
13604+
type: boolean
1353713605
baseDn:
1353813606
type: string
1353913607
PatchRequest:
@@ -13620,6 +13688,9 @@ components:
1362013688
type: boolean
1362113689
accessEvaluationScriptName:
1362213690
type: string
13691+
accessEvaluationDiscoveryCacheLifetimeInMinutes:
13692+
type: integer
13693+
format: int32
1362313694
requireRequestObjectEncryption:
1362413695
type: boolean
1362513696
requirePkce:
@@ -13906,6 +13977,9 @@ components:
1390613977
accessTokenLifetime:
1390713978
type: integer
1390813979
format: int32
13980+
userInfoLifetime:
13981+
type: integer
13982+
format: int32
1390913983
cleanServiceInterval:
1391013984
type: integer
1391113985
format: int32
@@ -14069,6 +14143,8 @@ components:
1406914143
type: string
1407014144
shareSubjectIdBetweenClientsWithSameSectorId:
1407114145
type: boolean
14146+
useOpenidSubAttributeValueForPairwiseLocalAccountId:
14147+
type: boolean
1407214148
webKeysStorage:
1407314149
type: string
1407414150
enum:
@@ -14386,8 +14462,6 @@ components:
1438614462
type: boolean
1438714463
lockMessageConfig:
1438814464
$ref: '#/components/schemas/LockMessageConfig'
14389-
fapi:
14390-
type: boolean
1439114465
allResponseTypesSupported:
1439214466
uniqueItems: true
1439314467
type: array
@@ -14397,6 +14471,8 @@ components:
1439714471
- code
1439814472
- token
1439914473
- id_token
14474+
fapi:
14475+
type: boolean
1440014476
AuthenticationFilter:
1440114477
required:
1440214478
- baseDn
@@ -15163,10 +15239,10 @@ components:
1516315239
type: array
1516415240
items:
1516515241
type: object
15166-
displayValue:
15167-
type: string
1516815242
value:
1516915243
type: object
15244+
displayValue:
15245+
type: string
1517015246
LocalizedString:
1517115247
type: object
1517215248
properties:
@@ -15468,6 +15544,7 @@ components:
1546815544
- uma_rpt_claims
1546915545
- uma_claims_gathering
1547015546
- access_evaluation
15547+
- access_evaluation_discovery
1547115548
- consent_gathering
1547215549
- dynamic_scope
1547315550
- spontaneous_scope
@@ -16046,6 +16123,8 @@ components:
1604616123
type: string
1604716124
online_access:
1604816125
type: boolean
16126+
authorization_challenge:
16127+
type: boolean
1604916128
attributes:
1605016129
type: object
1605116130
additionalProperties:
@@ -16330,15 +16409,15 @@ components:
1633016409
type: string
1633116410
username:
1633216411
type: string
16333-
domain:
16412+
origin:
1633416413
type: string
1633516414
userId:
1633616415
type: string
1633716416
challenge:
1633816417
type: string
16339-
attenstationRequest:
16418+
attestationRequest:
1634016419
type: string
16341-
attenstationResponse:
16420+
attestationResponse:
1634216421
type: string
1634316422
uncompressedECPoint:
1634416423
type: string
@@ -16361,8 +16440,28 @@ components:
1636116440
signatureAlgorithm:
1636216441
type: integer
1636316442
format: int32
16364-
applicationId:
16443+
rpId:
1636516444
type: string
16445+
backupStateFlag:
16446+
type: boolean
16447+
backupEligibilityFlag:
16448+
type: boolean
16449+
attestedCredentialDataFlag:
16450+
type: boolean
16451+
extensionDataFlag:
16452+
type: boolean
16453+
userVerifiedFlag:
16454+
type: boolean
16455+
userPresentFlag:
16456+
type: boolean
16457+
authentictatorAttachment:
16458+
type: string
16459+
credId:
16460+
type: string
16461+
transports:
16462+
type: array
16463+
items:
16464+
type: string
1636616465
Fido2RegistrationEntry:
1636716466
type: object
1636816467
properties:

admin-ui/plugins/auth-server/components/Agama/AgamaListPage.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
getAgama,
1313
deleteAgama,
1414
addAgama,
15+
getAgamaRepository,
16+
getAgamaRepositoryFile
1517
} from "Plugins/auth-server/redux/features/agamaSlice";
1618
import { hasPermission, AGAMA_READ, AGAMA_WRITE } from "Utils/PermChecker";
1719
import GluuViewWrapper from "Routes/Apps/Gluu/GluuViewWrapper";
@@ -24,7 +26,7 @@ import CircularProgress from "@mui/material/CircularProgress";
2426
import InfoIcon from "@mui/icons-material/Info";
2527
import AgamaProjectConfigModal from "./AgamaProjectConfigModal";
2628
import { updateToast } from "Redux/features/toastSlice";
27-
import { isEmpty, set } from "lodash";
29+
import { isEmpty } from "lodash";
2830
import { getJsonConfig } from "Plugins/auth-server/redux/features/jsonConfigSlice";
2931
import SettingsIcon from "@mui/icons-material/Settings";
3032
import Checkbox from "@mui/material/Checkbox";
@@ -33,10 +35,7 @@ import FormControlLabel from "@mui/material/FormControlLabel";
3335
import FormLabel from "@mui/material/FormLabel";
3436
import GluuTabs from "Routes/Apps/Gluu/GluuTabs";
3537
import { toast } from "react-toastify";
36-
import {
37-
getAgamaRepository,
38-
getAgamaRepositoryFile,
39-
} from "../../redux/features/agamaSlice";
38+
4039

4140
const dateTimeFormatOptions = {
4241
year: "2-digit",
@@ -258,7 +257,7 @@ function AgamaListPage() {
258257
if (hasPermission(permissions, AGAMA_WRITE)) {
259258
myActions.push({
260259
icon: "add",
261-
tooltip: `${t("messages.add_role")}`,
260+
tooltip: `${t("titles.add_new_agama_project")}`,
262261
iconProps: { color: "primary" },
263262
isFreeAction: true,
264263
onClick: () => {
@@ -380,6 +379,7 @@ function AgamaListPage() {
380379
setProjectName(repo["repository-name"]);
381380
dispatch(getAgamaRepositoryFile({ downloadurl: repo["download-link"] }));
382381
} catch (error) {
382+
console.log(error);
383383
toast.error("File not found");
384384
}
385385
};
@@ -494,9 +494,9 @@ function AgamaListPage() {
494494
{fileLoading ? (
495495
<CircularProgress />
496496
) : agamaRepostoriesList?.projects?.length ? (
497-
agamaRepostoriesList.projects.map((item, index) => (
497+
agamaRepostoriesList?.projects?.map((item, index) => (
498498
<FormControlLabel
499-
key={index}
499+
key={item["repository-name"]}
500500
control={
501501
<Checkbox
502502
checked={repoName === item["repository-name"]}
@@ -515,7 +515,7 @@ function AgamaListPage() {
515515
}
516516
label={
517517
<div>
518-
<div style={{ marginTop: 6 }}>{item.name}</div>
518+
<div>{item['repository-name']}</div>
519519
<div
520520
style={{
521521
fontSize: "12px",

admin-ui/plugins/auth-server/redux/api/AgamaApi.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,11 @@ export default class AgamaApi {
3939
})
4040
}
4141

42-
getAgamaRepositories = (payload) => {
43-
const { token } = payload
42+
getAgamaRepositories = () => {
4443
return new Promise((resolve, reject) => {
45-
axios.get('/api/v1/agama-repo/', {
46-
headers: {
47-
Authorization: 'Bearer ' + token
48-
}
44+
this.api.getAgamaRepositories((error, data) => {
45+
handleResponse(error, reject, resolve, data)
4946
})
50-
.then((response) => {
51-
resolve(response)
52-
})
53-
.catch((error) => {
54-
reject(error)
55-
})
5647
})
5748
}
5849

admin-ui/plugins/auth-server/redux/sagas/AgamaSaga.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,9 @@ export function* deleteAgamas(payload) {
6868

6969
export function* getAgamaRepository() {
7070
try {
71-
const token = yield select((state) => state.authReducer.token.access_token);
72-
73-
const payload = { token };
7471
const api = yield* newFunction();
75-
const data = yield call(api.getAgamaRepositories, payload);
76-
77-
yield put(getAgamaRepositoriesResponse(data.data));
72+
const data = yield call(api.getAgamaRepositories);
73+
yield put(getAgamaRepositoriesResponse(data));
7874
return data;
7975
} catch (e) {
8076
if (isFourZeroOneError(e)) {

0 commit comments

Comments
 (0)