Skip to content

Commit

Permalink
generate kuadrant authconfig: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Jan 26, 2022
1 parent e7b9c9a commit e93c618
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ go install github.com/kuadrant/kuadrantctl@latest
* [Apply Kuadrant API objects](doc/api-apply.md)
* [Generate Istio virtualservice objects](doc/generate-istio-virtualservice.md)
* [Generate Istio authenticationpolicy objects](doc/generate-istio-authorizationpolicy.md)
* [Generate kuadrat authconfig objects](doc/generate-kuadrant-authconfig.md)

## Contributing
The [Development guide](doc/development.md) describes how to build the kuadrantctl CLI and how to test your changes before submitting a patch or opening a PR.
Expand Down
4 changes: 4 additions & 0 deletions cmd/generate_kuadrant_authconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func generateKuadrantAuthConfig(cmd *cobra.Command, doc *openapi3.T) (*authorino
}

authConfig := &authorinov1beta1.AuthConfig{
TypeMeta: metav1.TypeMeta{
Kind: "AuthConfig",
APIVersion: "authorino.kuadrant.io/v1beta1",
},
ObjectMeta: metav1.ObjectMeta{
Name: objectName,
},
Expand Down
29 changes: 29 additions & 0 deletions doc/generate-kuadrant-authconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Generate Kuadrant AuthConfig objects

The `kuadrantctl generate kuadrant authconfig` command generates an [Authorino AuthConfig](https://github.com/Kuadrant/authorino/blob/v0.7.0/docs/architecture.md#the-authorino-authconfig-custom-resource-definition-crd)
from your [OpenAPI Specification (OAS) 3.x](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md) and kubernetes service information.

### OpenAPI specification

OpenAPI document resource can be provided by one of the following channels:
* Filename in the available path.
* URL format (supported schemes are HTTP and HTTPS). The CLI will try to download from the given address.
* Read from stdin standard input stream.

### Usage :

```shell
$ kuadrantctl generate kuadrant authconfig -h
Generate kuadrant authconfig from OpenAPI 3.x

Usage:
kuadrantctl generate kuadrant authconfig [flags]

Flags:
-h, --help help for authconfig
--oas string /path/to/file.[json|yaml|yml] OR http[s]://domain/resource/path.[json|yaml|yml] OR - (required)
--public-host string The address used by a client when attempting to connect to a service (required)

Global Flags:
-v, --verbose verbose output
```

0 comments on commit e93c618

Please sign in to comment.