Skip to content

Commit cbaa93c

Browse files
authored
Add tenant to the management flow options (#629)
1 parent 159e47c commit cbaa93c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

descope/internal/mgmt/flow_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ func TestImportThemeMissingArgument(t *testing.T) {
133133
func TestRunManagementFlowSuccess(t *testing.T) {
134134
flowID := "test-flow"
135135
options := &descope.MgmtFlowOptions{
136-
Input: map[string]any{"key": "value"},
136+
Input: map[string]any{"key": "value"},
137+
Tenant: "tenant-id",
137138
}
138139
output := map[string]any{
139140
"result": "success",
@@ -150,6 +151,7 @@ func TestRunManagementFlowSuccess(t *testing.T) {
150151
require.NotNil(t, req["options"])
151152
optionsMap := req["options"].(map[string]any)
152153
require.Equal(t, map[string]any{"key": "value"}, optionsMap["input"])
154+
require.Equal(t, "tenant-id", optionsMap["tenant"])
153155
}, body))
154156
res, err := mgmt.Flow().RunManagementFlow(context.Background(), flowID, options)
155157
require.NoError(t, err)

descope/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,4 +1386,5 @@ type MgmtUserRequest struct {
13861386
type MgmtFlowOptions struct {
13871387
Input map[string]any `json:"input,omitempty"`
13881388
Preview bool `json:"preview,omitempty"`
1389+
Tenant string `json:"tenant,omitempty"`
13891390
}

0 commit comments

Comments
 (0)