Skip to content

Move to Harness Client API #7

@vody

Description

@vody

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions