mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
* fix(appconfig): add DeleteConfigurationProfile/DeleteHostedConfigurationVersion/ListDeploymentStrategies/DeleteDeploymentStrategy
These four operations had no route at all, so a request fell through
to S3's generic path-style catch-all (GET/DELETE /{bucket}[/{key}])
and returned a misleading NoSuchBucket 404 instead of a real AppConfig
response - confirmed via both raw HTTP and the real AWS SDK for Java.
Adds the missing routes + AppConfigService methods, mirroring existing
precedent (DeleteConfigurationProfile/DeleteHostedConfigurationVersion/
DeleteDeploymentStrategy follow DeleteApplication's idempotent-delete
convention - no upfront existence check; ListDeploymentStrategies
includes the three predefined strategies alongside custom ones,
verified against the API reference's own sample response).
DeleteDeploymentStrategy's real path is /deployementstrategies/{id}
(extra "e" - a genuine, documented quirk in AWS's own API model; every
other deployment-strategy operation correctly uses
/deploymentstrategies). Confirmed against the API reference and
reproduced against the real SDK, which sends the misspelled path
literally - matched it rather than "fixing" it, since wire-protocol
fidelity to what AWS actually does is the point.
Regenerated docs/services/appconfig.md's Supported Operations list
(hand-maintained for REST controllers - not yet covered by
tools/docs/regen_action_docs.py, confirmed via services.yaml's own
Phase-1 scope comment).
Tests: AppConfigIntegrationTest (+4), compatibility-tests/sdk-test-java
AppConfigTest (+1, covering all four operations via the real SDK).
Ran locally (JDK 25):
AppConfigIntegrationTest (unit): 29/29 passed
AppConfigTest (SDK compat, live): 16/16 passed
* fix(appconfig): scope profile deletion to its application, reject deleting predefined strategies
Review feedback on #2280 (Copilot + Greptile, both independently):
- deleteConfigurationProfile ignored appId entirely and deleted by the
bare, globally-keyed profileId - a caller could delete another
application's profile just by guessing/reusing its ID, since
sibling reads (getConfigurationProfile) already enforce this
ownership check but the new delete route didn't. Now rejects with
the same ResourceNotFoundException as a mismatched get; a profileId
that doesn't exist anywhere is still an idempotent no-op, matching
deleteApplication's existing convention - only an existing-but-
wrongly-scoped one is rejected.
- Same method also now cascades the delete to that profile's hosted
configuration versions - they aren't independently addressable
outside a profile's lifecycle, so leaving them in versionStore after
the profile was "deleted" let a caller keep fetching versions for a
profile that supposedly no longer exists.
- deleteDeploymentStrategy silently reported success (204) for a
predefined strategy (e.g. AppConfig.AllAtOnce) without doing
anything, since builtins were never in strategyStore in the first
place - the strategy would still exist and still show up in every
subsequent Get/List call despite the "successful" delete. Now
rejects with BadRequestException.
Also applied this project's own established cleanup-logging
convention (System.err.println on a best-effort catch, matching
several other compatibility-tests/sdk-test-java files) to the one new
try/finally block flagged by Greptile, rather than swallowing the
exception silently.
Tests: 2 new AppConfigIntegrationTest cases (cross-application delete
rejected + original untouched, predefined-strategy delete rejected +
still resolvable) and 2 new SDK compatibility tests using the real
AWS SDK for Java v2's exception types.
AppConfigIntegrationTest: 31/31 passed
AppConfigTest (SDK compat, live): 18/18 passed
* chore: retrigger CI
117 lines
3.2 KiB
Markdown
117 lines
3.2 KiB
Markdown
# AppConfig
|
|
|
|
Floci supports AWS AppConfig and AppConfigData for local configuration management.
|
|
|
|
## Management Plane (AppConfig)
|
|
|
|
The management plane allows you to create and manage applications, environments, configuration profiles, and hosted configuration versions.
|
|
|
|
### Supported Operations
|
|
|
|
- `CreateApplication`
|
|
- `GetApplication`
|
|
- `ListApplications`
|
|
- `DeleteApplication`
|
|
- `CreateEnvironment`
|
|
- `GetEnvironment`
|
|
- `ListEnvironments`
|
|
- `CreateConfigurationProfile`
|
|
- `GetConfigurationProfile`
|
|
- `ListConfigurationProfiles`
|
|
- `DeleteConfigurationProfile`
|
|
- `CreateHostedConfigurationVersion`
|
|
- `GetHostedConfigurationVersion`
|
|
- `DeleteHostedConfigurationVersion`
|
|
- `CreateDeploymentStrategy`
|
|
- `GetDeploymentStrategy`
|
|
- `ListDeploymentStrategies`
|
|
- `DeleteDeploymentStrategy`
|
|
- `StartDeployment`
|
|
- `GetDeployment`
|
|
|
|
## Data Plane (AppConfigData) {#data-plane}
|
|
|
|
The data plane is used by applications to retrieve the active configuration for an environment and profile.
|
|
|
|
### Supported Operations
|
|
|
|
- `StartConfigurationSession`
|
|
- `GetLatestConfiguration`
|
|
|
|
## Configuration
|
|
|
|
| Variable | Default | Description |
|
|
|---|---|---|
|
|
| `FLOCI_SERVICES_APPCONFIG_ENABLED` | `true` | Enable or disable the AppConfig management plane |
|
|
| `FLOCI_SERVICES_APPCONFIGDATA_ENABLED` | `true` | Enable or disable the AppConfigData retrieval plane |
|
|
|
|
## Example Usage
|
|
|
|
### 1. Create an Application and Environment
|
|
|
|
```bash
|
|
# Create application
|
|
aws appconfig create-application --name my-app --endpoint-url http://localhost:4566
|
|
|
|
# Create environment
|
|
aws appconfig create-environment --application-id <app-id> --name dev --endpoint-url http://localhost:4566
|
|
```
|
|
|
|
### 2. Create a Hosted Configuration
|
|
|
|
```bash
|
|
# Create configuration profile
|
|
aws appconfig create-configuration-profile \
|
|
--application-id <app-id> \
|
|
--name my-profile \
|
|
--location-uri hosted \
|
|
--type AWS.Freeform \
|
|
--endpoint-url http://localhost:4566
|
|
|
|
# Create hosted configuration version
|
|
aws appconfig create-hosted-configuration-version \
|
|
--application-id <app-id> \
|
|
--configuration-profile-id <profile-id> \
|
|
--content "{\"foo\": \"bar\"}" \
|
|
--content-type application/json \
|
|
--endpoint-url http://localhost:4566
|
|
```
|
|
|
|
### 3. Deploy the Configuration
|
|
|
|
```bash
|
|
# Create immediate deployment strategy
|
|
aws appconfig create-deployment-strategy \
|
|
--name immediate \
|
|
--deployment-duration-in-minutes 0 \
|
|
--growth-factor 100 \
|
|
--final-bake-time-in-minutes 0 \
|
|
--endpoint-url http://localhost:4566
|
|
|
|
# Start deployment
|
|
aws appconfig start-deployment \
|
|
--application-id <app-id> \
|
|
--environment-id <env-id> \
|
|
--configuration-profile-id <profile-id> \
|
|
--configuration-version 1 \
|
|
--deployment-strategy-id <strategy-id> \
|
|
--endpoint-url http://localhost:4566
|
|
```
|
|
|
|
### 4. Retrieve Configuration via Data Plane
|
|
|
|
```bash
|
|
# Start configuration session
|
|
TOKEN=$(aws appconfigdata start-configuration-session \
|
|
--application-identifier <app-id> \
|
|
--environment-identifier <env-id> \
|
|
--configuration-profile-identifier <profile-id> \
|
|
--query "InitialConfigurationToken" --output text \
|
|
--endpoint-url http://localhost:4566)
|
|
|
|
# Get latest configuration
|
|
aws appconfigdata get-latest-configuration \
|
|
--configuration-token $TOKEN \
|
|
--endpoint-url http://localhost:4566
|
|
```
|