cnabio / cnab-go

A Go implementation of CNAB Core 1.0
MIT License
69 stars 37 forks source link

Check credential.ApplyTo setting credentials on the operation #242

Closed carolynvs closed 3 years ago

carolynvs commented 3 years ago

When we go through the credentials and set them on the operation, creating either environment variables or paths, take into account credential.ApplyTo and do not error out when the credential is required but doesn't apply to the current action.

This builds on top of my previous PR that added support for credentials to use ApplyTo, where I had missed that we have duplicate logic for validating credentials depending on the context (populating the operation vs validating a credential set).

carolynvs commented 3 years ago

Sorry that I didn't get this right the first time! 😓