You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an API Client I want to be able to create service credential bindings for UPSI via the POST /v3/service_credential_bindings API So that I can bind a UPSI to my apps
Acceptance Criteria
Happy Path: binding type is app
GIVEN I have permission to create K8s ServiceBindings in the requested namespace WHEN I make the following request to POST /v3/service_credential_bindings
AND I See a CFServiceBinding resource pointing to the CFApp. Would look something like this:
---
apiVersion: services.cloudfoundry.org/v1alpha1kind: CFServiceBinding…metadata:
…name: 9b2129fa-94e4-4359-a83a-b577a57939d9 # service binding guidnamespace: my-cf-space-guidlabels:
servicebinding.io/provisioned-service: "true"spec:
name: my-binding-nameservice:
apiVersion: services.cloudfoundry.org/v1alpha1kind: CFServiceInstancename: 3bd795f2-8f50-4b75-b443-37b6e5dca393 # service instance GUIDsecretName: cf-service-credentials-3bd795f2-8f50-4b75-b443-37b6e5dca393 #shares the same secret as the UPSIappRef:
name: 3bd795f2-8f50-4b75-b443-37b6e5dca393 # CFApp GUID…status:
…binding:
name: cf-service-credentials-my-upsi-guid
Sad Path: binding type is key
GIVEN I have permission to create K8s ServiceBindings in the requested namespace WHEN I make the following request to POST /v3/service_credential_bindings
HTTP/1.1 422 Unprocessable Entity
{
"errors": [
{
"code": 10008,
"detail": "Service credential bindings of type 'key' are not supported for user-provided service instances.",
"title": "CF-UnprocessableEntity"
}
]
}
Sad Path: App is already bound to the Service Instance
GIVEN I have already created a CFServiceBinding for a given App and Service Instance WHEN I Try to create a duplicate binding THEN I Get a 422 error saying "The app is already bound to the service instance"
Updated since IPM with two additional acceptance criteria around the App/Service Instance being in separate spaces (422) and duplicate service bindings (422).
@tcdowney and I just talked this over, and decided that we should move the secret's name should only be present in the status, and that the controller should be responsible for setting it. This makes the flow the same for user-provided and managed services, so that the user/client doesn't have to handle the (potentially asynchronous) binding credential creation.
Blockers/Dependencies
cf create-user-provided-service
to store service credentials in a user-provided service instance #430Background
As an API Client
I want to be able to create service credential bindings for UPSI via the
POST /v3/service_credential_bindings
APISo that I can bind a UPSI to my apps
Acceptance Criteria
Happy Path: binding type is
app
GIVEN I have permission to create K8s ServiceBindings in the requested namespace
WHEN I make the following request to
POST /v3/service_credential_bindings
THEN I see the following response
AND I See a
CFServiceBinding
resource pointing to theCFApp
. Would look something like this:Sad Path: binding type is
key
GIVEN I have permission to create K8s ServiceBindings in the requested namespace
WHEN I make the following request to
POST /v3/service_credential_bindings
THEN I get a
422
responseSad Path: App is already bound to the Service Instance
GIVEN I have already created a
CFServiceBinding
for a given App and Service InstanceWHEN I Try to create a duplicate binding
THEN I Get a
422
error saying "The app is already bound to the service instance"Related code: https://github.com/cloudfoundry/cloud_controller_ng/blob/02e0035da375c20cafa807f895b2de60fbd4a862/app/actions/service_credential_binding_app_create.rb#L35
Sad Path: App and Service Instance are not in the same space
GIVEN The App and Service instance that I'm trying to bind are in separate spaces
WHEN I make the following request
THEN I Get a
422
error saying "The service instance and the app are in different spaces"Sad Path: service instance belongs to a space the user does not have permissions in
GIVEN I do not have permission to create service bindings in the namespace in which the service instance lives
WHEN I make the following request
THEN I get a
403
error with the messageYou are not authorized to perform the requested action
Dev Notes
CFServiceBinding
being created. Credential projection will come in a future story"name"
is optional for service bindings!422
, so you will need to add labels or some mechanism for detecting duplicate bindingsResources:
The text was updated successfully, but these errors were encountered: