Skip to content

Commit

Permalink
fix(authentication/methods): formatting due to code group spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Jan 26, 2024
1 parent 2d74f34 commit 1946277
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions authentication/methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ The SDKs that currently support this include:
- Go

<CodeGroup>

```go sdk.go
package main

Expand All @@ -196,31 +197,30 @@ import (
)

func main() {
// The following constructs an instance of the SDK which communicates with
// instances of Flipt deployed in the same cluster.
// In this example, we assume Flipt is reachable via a k8s service named
// `flipt` deployed into the namespace `flipt`.
//
// The kubernetes provider automatically authenticates the client with this
// Flipt service. It also ensures that the credentials are kept up to date
// and automatically refreshed before they expire.
transport := http.NewTransport("http://flipt.flipt.svc.cluster.local:8080")
sdk := sdk.New(transport, sdk.WithAuthenticationProvider(
sdk.NewKubernetesAuthenticationProvider(transport),
))
// The following constructs an instance of the SDK which communicates with
// instances of Flipt deployed in the same cluster.
// In this example, we assume Flipt is reachable via a k8s service named
// `flipt` deployed into the namespace `flipt`.
//
// The kubernetes provider automatically authenticates the client with this
// Flipt service. It also ensures that the credentials are kept up to date
// and automatically refreshed before they expire.
transport := http.NewTransport("http://flipt.flipt.svc.cluster.local:8080")
sdk := sdk.New(transport, sdk.WithAuthenticationProvider(
sdk.NewKubernetesAuthenticationProvider(transport),
))
}

````
```

</CodeGroup>


### Via the API

Acquiring a client token via this method can be performed manually from inside a pod.
The following uses `curl` to illustrate how a local, valid service account token can be used in this way.

<CodeGroup>

```bash client-token.sh
# assumes both curl and jq are installed
curl -s -X POST http://flipt:8080/auth/v1/method/kubernetes/serviceaccount \
Expand All @@ -243,7 +243,7 @@ curl -s -X POST http://flipt:8080/auth/v1/method/kubernetes/serviceaccount \
}
}
}
````
```

</CodeGroup>

Expand Down

0 comments on commit 1946277

Please sign in to comment.