Skip to content

Add virtual-entitlements create command#135

Merged
robert-chiniquy merged 4 commits intomainfrom
add-virtual-entitlements
Mar 30, 2026
Merged

Add virtual-entitlements create command#135
robert-chiniquy merged 4 commits intomainfrom
add-virtual-entitlements

Conversation

@afalahi
Copy link
Copy Markdown
Contributor

@afalahi afalahi commented Mar 27, 2026

Summary

  • Adds cone virtual-entitlements create command for creating manually-managed resource types, resources, and entitlements on ConductorOne apps
  • Supports both CLI flags (--app, --resource, --type, --entitlements) and YAML file input (--from-file)
  • Adds client methods: CreateManuallyManagedResourceType, CreateManuallyManagedResource, CreateAppEntitlement, SearchApps, ResolveAppByNameOrID

Usage

# CLI flags
cone virtual-entitlements create --app "My App" --resource "My Group" --type GROUP --entitlements "Member" --entitlements "Admin"

# YAML file
cone virtual-entitlements create --app "My App" --from-file entitlements.yaml

Test plan

  • Build passes (make build)
  • go vet ./... passes
  • go test ./... passes
  • cone virtual-entitlements --help shows subcommand
  • cone virtual-entitlements create --help shows all flags
  • Test create with CLI flags against a real tenant
  • Test create with YAML file against a real tenant
  • Test app resolution by name and by ID

Add `cone virtual-entitlements create` for creating manually-managed
resource types, resources, and entitlements on ConductorOne apps.
Supports both CLI flags and YAML file input.
@robert-chiniquy robert-chiniquy enabled auto-merge (squash) March 27, 2026 21:56
@afalahi afalahi force-pushed the add-virtual-entitlements branch 2 times, most recently from 2fb9239 to 57b4765 Compare March 29, 2026 13:38
Fix gosec false positives with nolint annotations, lowercase error
strings per Go convention, and simplify embedded field selectors.
@afalahi afalahi force-pushed the add-virtual-entitlements branch from 57b4765 to 467b728 Compare March 29, 2026 13:40
ResolveResourceType was title-casing the normalized enum key, which
produced incorrect display names for multi-word types (e.g.
"Profile_type" instead of "Profile Type"). Use a dedicated map of
canonical display names matching the C1 server conventions.

Also document the slug collision behavior in makeSlug.
Resolve conflicts in main.go and client.go — keep both
virtualEntitlements and generateAlias additions.
const durationInputTip = "We accept a sequence of decimal numbers, each with optional fraction and a unit suffix," +
"such as \"12h\", \"1w2d\" or \"2h45m\". Valid units are (m)inutes, (h)ours, (d)ays, (w)eeks."
const justificationWarningMessage = "Please provide a justification when requesting access to an entitlement."
const justificationWarningMessage = "please provide a justification when requesting access to an entitlement"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting

@robert-chiniquy robert-chiniquy merged commit e578ff6 into main Mar 30, 2026
2 checks passed
@robert-chiniquy robert-chiniquy deleted the add-virtual-entitlements branch March 30, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants