thetanz / OpenFeature-al

OpenFeature for AL transforms Application Areas into feature toggles.
https://theta.co.nz
GNU Lesser General Public License v3.0
21 stars 5 forks source link

Move to Harness Client API #7

Open vody opened 1 year ago

vody commented 1 year ago

Harness provides proxy service endpoints (https://config.ff.harness.io/api/1.0 and https://events.ff.harness.io/api/1.0) designed to be used by client SDK's. These endpins are way faster and provide the ability to report back feature usage information back to Harness.

Authentication

POST https://config.ff.harness.io/api/1.0/client/auth
Content-Type: application/json

{
    "apiKey": "{{APIKey}}",
    "target": {
        "identifier": "{{Target}}",
        "name": "Anonymous User",
        "anonymous": true,
        "attributes": {}
    }
}

Fetch Flags

GET https://config.ff.harness.io/api/1.0/client/env/{{Environment}}/target/{{Target}}/evaluations?cluster={{ClusterIdentifier}}
Authorization: Bearer {{Authentication.response.body.authToken}}

Post Metrics

POST https://events.ff.harness.io/api/1.0/metrics/{{Environment}}?cluster={{ClusterIdentifier}}
Content-Type: application/json
Authorization: Bearer {{Authenticate.response.body.authToken}}

{
    "metricsData": [
        {
            "timestamp": 1683682952998,
            "count":1,
            "metricsType":"FFMETRICS",
            "attributes": [
                { "key":"featureIdentifier", "value":"{{Flag}}" },
                { "key":"variationIdentifier", "value":"{{Identifier}}" },
                { "key":"target", "value":"{{Target}}" }
            ]
        }
    ]
}

To progress on this we need to be able to parse JWT token in BC. There are already dotnet available but need a proper AL wrapper. Client Add-in will not be an acceptable option as it makes the overall solution too complex to enable Harness publisher. Option with external parser is not acceptable as well as non of the partners want's their access key to be exposed to third party service.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.