Skip to content

Commit

Permalink
add created time for tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
OfekAvergil committed Sep 11, 2024
1 parent d13b19c commit fadfd4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions descope/internal/mgmt/tenant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func TestAllTenantsLoadSuccess(t *testing.T) {
"id": "t1",
"name": "abc",
"selfProvisioningDomains": []string{"domain.com"},
"CreatedTime": int32(1726067547),
}}}
mgmt := newTestMgmt(nil, helpers.DoOkWithBody(func(r *http.Request) {
require.Equal(t, r.Header.Get("Authorization"), "Bearer a:key")
Expand All @@ -129,6 +130,8 @@ func TestAllTenantsLoadSuccess(t *testing.T) {
require.Equal(t, "abc", res[0].Name)
require.Len(t, res[0].SelfProvisioningDomains, 1)
require.Equal(t, "domain.com", res[0].SelfProvisioningDomains[0])
require.Equal(t, int32(1726067547), res[0].CreatedTime)

}

func TestAllTenantsLoadError(t *testing.T) {
Expand Down Expand Up @@ -178,6 +181,7 @@ func TestTenantLoadSuccess(t *testing.T) {
"id": "t1",
"name": "abc",
"selfProvisioningDomains": []string{"domain.com"},
"CreatedTime": int32(1726067547),
}
mgmt := newTestMgmt(nil, helpers.DoOkWithBody(func(r *http.Request) {
require.Equal(t, r.Header.Get("Authorization"), "Bearer a:key")
Expand All @@ -189,6 +193,7 @@ func TestTenantLoadSuccess(t *testing.T) {
require.Equal(t, "abc", res.Name)
require.Len(t, res.SelfProvisioningDomains, 1)
require.Equal(t, "domain.com", res.SelfProvisioningDomains[0])
require.Equal(t, int32(1726067547), res.CreatedTime)
}

func TestTenantLoadError(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions descope/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ type Tenant struct {
CustomAttributes map[string]any `json:"customAttributes,omitempty"`
AuthType string `json:"authType,omitempty"`
Domains []string `json:"domains,omitempty"`
CreatedTime int32 `json:"createdTime,omitempty"`
}

type TenantRequest struct {
Expand Down

0 comments on commit fadfd4f

Please sign in to comment.