Skip to content

Commit 72c0ae6

Browse files
Merge pull request #2503 from thiva-k/add-agent-entity
Introduce agent entity and APIs
2 parents f35fb3d + 0281d13 commit 72c0ae6

23 files changed

Lines changed: 7277 additions & 18 deletions

File tree

api/agent.yaml

Lines changed: 1778 additions & 0 deletions
Large diffs are not rendered by default.

api/group.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@ components:
979979
- user
980980
- group
981981
- app
982+
- agent
982983
display:
983984
type: string
984985
readOnly: true

api/role.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ components:
876876
- user
877877
- group
878878
- app
879+
- agent
879880
description: |
880881
Filter assignments by assignee type. When omitted, assignments of all types are returned.
881882
includeQueryParam:
@@ -898,14 +899,15 @@ components:
898899
id:
899900
type: string
900901
format: uuid
901-
description: "ID of the user, app, or group being assigned"
902+
description: "ID of the user, app, agent, or group being assigned"
902903
type:
903904
type: string
904905
enum:
905906
- user
906907
- group
907908
- app
908-
description: "Type of entity being assigned (user, app, or group)"
909+
- agent
910+
description: "Type of entity being assigned (user, app, agent, or group)"
909911
display:
910912
type: string
911913
readOnly: true
@@ -918,14 +920,15 @@ components:
918920
id:
919921
type: string
920922
format: uuid
921-
description: "ID of the user, app, or group being assigned"
923+
description: "ID of the user, app, agent, or group being assigned"
922924
type:
923925
type: string
924926
enum:
925927
- user
926928
- group
927929
- app
928-
description: "Type of entity being assigned (user, app, or group)"
930+
- agent
931+
description: "Type of entity being assigned (user, app, agent, or group)"
929932

930933
ResourcePermissions:
931934
type: object

backend/cmd/server/servicemanager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package main
2222
import (
2323
"net/http"
2424

25+
"github.com/asgardeo/thunder/internal/agent"
2526
"github.com/asgardeo/thunder/internal/application"
2627
"github.com/asgardeo/thunder/internal/attributecache"
2728
"github.com/asgardeo/thunder/internal/authn"
@@ -287,6 +288,10 @@ func registerServices(mux *http.ServeMux) jwt.JWTServiceInterface {
287288
}
288289
exporters = append(exporters, applicationExporter)
289290

291+
if _, err := agent.Initialize(mux, entityService, inboundClientService, ouService); err != nil {
292+
logger.Fatal("Failed to initialize AgentService", log.Error(err))
293+
}
294+
290295
// Initialize design resolve service for theme and layout resolution
291296
designResolveService := resolve.Initialize(mux, themeMgtService, layoutMgtService, applicationService)
292297

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
3+
*
4+
* WSO2 LLC. licenses this file to you under the Apache License,
5+
* Version 2.0 (the "License"); you may not use this file except
6+
* in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing,
12+
* software distributed under the License is distributed on an
13+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
* KIND, either express or implied. See the License for the
15+
* specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
19+
package agent
20+
21+
const (
22+
agentBasePath = "/agents"
23+
)
24+
25+
// Field keys stored in the entity SystemAttributes JSON blob.
26+
const (
27+
fieldName = "name"
28+
fieldDescription = "description"
29+
fieldOwner = "owner"
30+
fieldClientID = "clientId"
31+
fieldClientSecret = "clientSecret"
32+
)

0 commit comments

Comments
 (0)