avioconsulting / mule-deploy-library

BSD 2-Clause "Simplified" License
0 stars 1 forks source link

ClientIDEnforcementCustom #75

Open kkingavio opened 1 year ago

kkingavio commented 1 year ago

Currently the DSL only allows for BasicAuth as an option for the client ID enforcement policy. There is an api/model class for the custom headers option, however, DSL fails to recognize it, so in muleDeploy.groovy, you have to specify it as a generic policy

Current: ` policies {

    mulesoftPolicy {
        assetId 'client-id-enforcement'
        version '1.2.3'
        config([
            credentialsOriginHasHttpBasicAuthenticationHeader: 'customExpression',
            clientIdExpression: '#[attributes.headers["client_id"]]',
            clientSecretExpression: '#[attributes.headers["client_secret"]]'
        ])
    }

}`

Expected: policies { clientEnforcementPolicyCustom { version '1.2.3' } }

kkingavio commented 1 year ago

Also, some tips to figure out the policy json, (or more exmples) would be nice in the readme.

Tim G recommended looking chrome browser network traffic for the json sent when applying the policy manually... it was a great tip, although the naming is slightly different...