aws-quickstart / cdk-eks-blueprints

AWS Quick Start Team
Apache License 2.0
422 stars 187 forks source link

FluxCD Github example uses unsupported Bearer token auth #999

Closed JamesMcMahon closed 2 weeks ago

JamesMcMahon commented 2 weeks ago

Describe the documentation issue

The example in the FluxCD Addon documentation is incorrect. FluxCD does not support bearer token auth with Github due to limitations in the Github API.

Specifically this secret will not work:

const externalSecret = new eks.KubernetesManifest(clusterInfo.cluster.stack, "ExternalSecret", {
    cluster: cluster,
    manifest: [
        {
            apiVersion: "external-secrets.io/v1beta1",
            kind: "ExternalSecret",
            metadata: {
                name: "git-admin-credentials",
                namespace: "flux-system"
            },
            spec: {
                secretStoreRef: {
                    name: "secret-manager-store",
                    kind: "ClusterSecretStore",
                },
                target: {
                    name: "repository-creds"
                },
                data: [
                    {
                        secretKey: "bearerToken",
                        remoteRef: {
                            key: "bearer-token-auth"
                        },
                    },
                ],
            },
        },
    ],
});
externalSecret.node.addDependency(secretStore);
return Promise.resolve(secretStore);
}

Instead Basic access authentication is needed.

FluxCD References:

Note: If you are looking to use OAuth tokens with popular servers (e.g. GitHub, Bitbucket, GitLab), you should use basic access authentication instead. These servers use basic HTTP authentication, with the OAuth token as the password. Check the documentation of your Git server for details.

Links

shapirov103 commented 2 weeks ago

@elamaran11 do you mind triaging this one?

elamaran11 commented 2 weeks ago

@shapirov103 Sure.

JamesMcMahon commented 2 weeks ago

If you are open to it I can put a PR together with a fix

elamaran11 commented 2 weeks ago

@JamesMcMahon If you can put a PR, that will be Awesome. We can review it and get it merged sooner.

JamesMcMahon commented 2 weeks ago

@elamaran11 - PR is up at https://github.com/aws-quickstart/cdk-eks-blueprints/pull/1000

JamesMcMahon commented 2 weeks ago

PR merged, closed