This is an automated email from the ASF dual-hosted git repository.

lahirujayathilake pushed a commit to branch custos-apps
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git

commit 6717e1798ef00b130dff72c54149d1432b3bccb9
Author: lahiruj <[email protected]>
AuthorDate: Tue Nov 10 02:30:41 2026 -0500

    Temp account app support to create users
---
 connectors/TempAccount/internal/handlers.go      | 3 +++
 connectors/TempAccount/pkg/tempaccount/loader.go | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/connectors/TempAccount/internal/handlers.go 
b/connectors/TempAccount/internal/handlers.go
index be9f21b23..9fd394901 100644
--- a/connectors/TempAccount/internal/handlers.go
+++ b/connectors/TempAccount/internal/handlers.go
@@ -27,6 +27,8 @@ import (
        "github.com/apache/airavata-custos/pkg/service"
 )
 
+const AppActionCreateUser = "temp-account:app:create-user"
+
 type Handlers struct {
        coreService *service.Service
 }
@@ -42,6 +44,7 @@ func (h *Handlers) RegisterRoutes(router *identity.Router) {
        router.RequirePrivilege("POST 
/connectors/temp-account/update-allocation", AccountsWrite, 
h.updateAllocationToTempAccount)
        router.RequirePrivilege("DELETE 
/connectors/temp-account/remove/{user_id}", AccountsWrite, h.removeTempAccount)
        router.RequirePrivilege("GET 
/connectors/temp-account/membership/{user_id}", AccountsRead, 
h.getAllocationMembershipForTempUser)
+       router.RequireApp("POST /connectors/temp-account/app/create", 
AppActionCreateUser, h.createTempAccount)
 }
 
 func (h *Handlers) createTempAccount(w http.ResponseWriter, r *http.Request) {
diff --git a/connectors/TempAccount/pkg/tempaccount/loader.go 
b/connectors/TempAccount/pkg/tempaccount/loader.go
index c3d163a87..d668417cb 100644
--- a/connectors/TempAccount/pkg/tempaccount/loader.go
+++ b/connectors/TempAccount/pkg/tempaccount/loader.go
@@ -25,6 +25,7 @@ import (
        "github.com/apache/airavata-custos/internal/config"
        "github.com/apache/airavata-custos/pkg/events"
        "github.com/apache/airavata-custos/pkg/identity"
+       "github.com/apache/airavata-custos/pkg/models"
        "github.com/apache/airavata-custos/pkg/service"
        "github.com/jmoiron/sqlx"
 )
@@ -34,6 +35,7 @@ const Type = "temp-account"
 
 func LoadConnector(ctx context.Context, _ *sqlx.DB, eventBus *events.Bus, 
coreService *service.Service, wg *sync.WaitGroup, router *identity.Router, 
connectorConfig *config.ConnectorConfig) error {
        handlers := internal.NewHandlers(coreService)
+       models.RegisterAppConnector(models.AppConnector{Name: Type, Actions: 
[]string{internal.AppActionCreateUser}})
        handlers.RegisterRoutes(router)
        return nil
 }

Reply via email to