feat(oci): add floci oci command group for the Floci OCI emulator - #15
Merged
Conversation
Adds the fourth product tree targeting floci-oci (port 4599, container
floci-oci, control prefix /_floci-oci, FLOCI_OCI_* env overrides):
start/stop/restart/status/logs/wait/version/services/doctor/env/config
plus stub snapshot commands, mirroring the GCP/Azure trees.
- 'floci oci env' exports OCI_CLI_ENDPOINT, FLOCI_OCI_ENDPOINT, and
TF_VAR_CLIENT_HOST_OVERRIDES for the OCI CLI, the ocilocal wrapper,
and the oracle/oci Terraform provider; also OCI_CLI_PROFILE=FLOCI
when that profile exists.
- 'floci oci setup' generates an RSA-2048 API signing key with a real
computed fingerprint and writes a throwaway [FLOCI] profile to
~/.oci/config (idempotent, never touches existing profiles) — the
OCI CLI/SDKs refuse to run without them.
- FlociHttpClient now accepts both health 'services' shapes: the array
reported by AWS/GCP/Azure servers and the {name: status} object
reported by floci-oci.
- 'floci config default-product oci' routes bare commands to the tree.
|
| Filename | Overview |
|---|---|
| src/main/java/io/floci/cli/commands/oci/OciEnvCommand.java | Shell-safe single-quoted exports and setup-profile detection for OCI_CLI_PROFILE; prior eval-injection and hardcoded FLOCI issues resolved. |
| src/main/java/io/floci/cli/commands/oci/OciServicesCommand.java | Uses resolvedEndpoint before FlociHttpClient so custom start ports work without --endpoint. |
| src/main/java/io/floci/cli/commands/oci/OciSetupCommand.java | Adds detectSetupProfile via key_file marker with FLOCI preference; supports env profile export for custom --profile-name. |
| src/test/java/io/floci/cli/unit/OciEnvFormatTest.java | Pins bash/fish/PowerShell quoting against hostile endpoint-style values. |
| src/test/java/io/floci/cli/unit/OciSetupCommandTest.java | Covers detectSetupProfile for custom names, FLOCI preference, and foreign key_file ignore. |
Reviews (2): Last reviewed commit: "fix(oci): address review findings on env..." | Re-trigger Greptile
- Single-quote 'oci env' exports with per-shell escaping (bash/fish/ PowerShell) so endpoint values containing shell metacharacters cannot inject commands through the documented 'eval $(floci oci env)' flow. - 'oci services' resolves the endpoint from the container port mapping like status/wait/env, so a container started with --port <n> is found without passing --endpoint. - 'oci env' exports OCI_CLI_PROFILE for whichever profile 'oci setup' wrote (detected via its key_file marker) instead of only the hardcoded FLOCI name; DEFAULT is skipped as the CLI uses it implicitly.
Contributor
Author
|
Addressed all three review findings in 5d731a0:
All 43 tests pass; |
14 tasks
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
floci oci— full lifecycle support for the Floci OCI (Oracle Cloud) emulator, the fourth product tree alongside AWS, GCP, and Azure. Includes the OCI-onlyfloci oci setup(the OCI CLI/SDKs require a config file + signing key, unlike the other clouds' env-var-only auth), endpoint env exports for the OCI CLI /ocilocal/ Terraform, and aFlociHttpClientfix to parse floci-oci's map-shaped healthservicesfield. Verified end-to-end against a running floci-oci container:oci os ns get, bucket/object round-trip, andeval $(floci oci env)as the single connect step.Type of change
fix:)feat:)feat!:orfix!:)Product trees affected
FlociCli, default-product,FlociHttpClient)commands/gcp/) — shared wiring onlycommands/az/) — shared wiring onlyAdds a new
commands/oci/tree (template predates it).Checklist
mvn testpasses locally (37 tests)OciSetupCommandTest— key/config creation, idempotency, append-without-clobber, custom profile name)CHANGELOG.mdentry added under[Unreleased]README.mdupdated (OCI quick start, command tables, global flags, env/setup docs, CI recipe)mvn package -Pnative) — RSA keygen + allocicommands smoke-tested in the native image