Files
iam/pkg/schema/workspace.go
zeekayandHanzo Dev 084011934f legal: dual MIT OR Apache-2.0, canonical licence text
This repo is public and its LICENSE called the source "confidential and
proprietary ... All rights reserved". Public visibility contradicts
confidentiality, and HIP-0130 puts `iam` in the OSS core tier. The declaration
now matches both.

LICENSE-APACHE and LICENSE-MIT carry the canonical texts, unedited —
LICENSE-APACHE is byte-identical to apache.org/licenses/LICENSE-2.0.txt
(sha256 cfc7749b…, 11358 bytes, blob d645695). LICENSE declares the pair.
LICENSE-MIT carries the copyright line the notice requires.

249 Go files led with `// Copyright 2026 Hanzo AI, Inc. All rights reserved.`
— the classic proprietary reservation, and a per-file contradiction of the new
grant. Each now carries `// SPDX-License-Identifier: MIT OR Apache-2.0`. The
word "confidential" survives untouched in the OIDC sense (confidential client),
which is protocol vocabulary, not a licence claim.

There is nothing else to declare: `go.mod` has no licence field and this repo
ships no Cargo/npm/PyPI manifest.

Relicensing is ours alone to do. The tree is original work, not a fork:
`fork: false` with no parent, its own root commit, and no Casdoor-lineage tag
is an ancestor of `main`. The retired Casdoor fork is `hanzoai/iam-v1`; the
provenance note in LICENSE names it, restoring the vendor name a clean-room
assertion needs in order to say what it is clean of.

Build, vet and all 29 test packages green.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-04 01:09:51 -07:00

43 lines
1.7 KiB
Go

// Copyright 2026 Hanzo AI, Inc.
// SPDX-License-Identifier: MIT OR Apache-2.0
package schema
import "github.com/hanzoai/orm"
// Workspace is an organization-scoped container that sits between the
// organization and its projects (v2 kind "workspaces"). The hierarchy is
// Organization → Workspace → Project: an organization contains workspaces; a
// workspace contains projects (Project.Workspace names its parent, empty ⇒
// org-level). Identity is the (Owner, Name) pair — Owner is the owning
// organization, so a workspace is a tenant-owned entity (authorized like
// projects/roles) — and the orm string key is "owner/name". Name is slug-safe:
// it doubles as the cross-surface `?workspace=` key. Workspaces carry no
// secrets, so there is no Mask.
//
// Bucket is the storage layer's S3 handle for the workspace: IAM records the
// binding (which bucket this workspace maps to); the storage service owns the
// physical bucket name and lifecycle. An empty Bucket means no storage binding.
//
// Tags carries orm:"serialize" so the column backends persist it through its
// string sibling; the default SQLite store round-trips the array inside the
// entity JSON blob and leaves the sibling empty.
type Workspace struct {
orm.Model[Workspace]
Owner string `json:"owner"`
Name string `json:"name"`
CreatedTime string `json:"createdTime"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
Organization string `json:"organization"`
Bucket string `json:"bucket"`
Tags []string `json:"tags" orm:"serialize" datastore:"-"`
Tags_ string `json:"-"`
Metadata string `json:"metadata"`
IsDefault bool `json:"isDefault"`
}