Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish examples #37

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/authn-middleware/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# AuthN Middleware Example

The example below demonstrates how to create a simple HTTP server that authenticates requests with JWT tokens.
The current example demonstrates how to create a simple HTTP server that authenticates requests with JWT tokens.

The complete code example is available in the [main.go](./main.go) file.

Configuration is stored in the [config.yml](./config.yml) file.

## Usage

Expand Down
2 changes: 0 additions & 2 deletions examples/authn-middleware/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ auth:
claimsCache:
enabled: true
maxEntries: 1000
introspection:
enabled: true
8 changes: 4 additions & 4 deletions examples/authn-middleware/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ func runApp() error {
}

type AppConfig struct {
Auth *authkit.Config `config:"auth"`
Log *log.Config `config:"log"`
Auth *authkit.Config
Log *log.Config
}

func NewAppConfig() *AppConfig {
return &AppConfig{
Log: log.NewConfig(),
Auth: authkit.NewConfig(),
Log: log.NewConfig(log.WithKeyPrefix("log")),
Auth: authkit.NewConfig(authkit.WithKeyPrefix("auth")),
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/idp-test-server/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IDP Test Server Example

This is a simple test server that can be used to test the IDP client.
This is a [simple test server](./main.go) that can be used to test the IDP client.
It demonstrates how the `idptest` package can be used to create a simple IDP server.

## Usage
Expand Down
8 changes: 6 additions & 2 deletions examples/token-introspection/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Token Introspection Example

The example below demonstrates how to create a simple HTTP server that authenticates requests with JWT tokens using the token introspection endpoint.
The current example demonstrates how to create a simple HTTP server that authenticates requests with JWT tokens using the token introspection endpoint.
Additionally, it performs authorization based on the introspected token's scope.

The complete code example is available in the [main.go](./main.go) file.

Configuration is stored in the [config.yml](./config.yml) file.

## Usage

To be able to run this example, you need to have the IDP test server running (see [IDP Test Server Example](../idp-test-server/README.md) for more details).
Expand Down Expand Up @@ -108,7 +112,7 @@ auth:
clientKey: <path_to_client_key>
```

If you want to test introspection via gRPC, you can use the [gRPC introspection server example](./grpc-server).
If you want to test introspection via gRPC, you can use the [gRPC introspection server example](./grpc-server/main.go).
To start the gRPC introspection server, just run `go run ./grpc-server/main.go`.

Then modify the `config.yaml` file to use the gRPC introspection endpoint:
Expand Down
8 changes: 4 additions & 4 deletions examples/token-introspection/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ func runApp() error {
}

type AppConfig struct {
Auth *authkit.Config `config:"auth"`
Log *log.Config `config:"log"`
Auth *authkit.Config
Log *log.Config
}

func NewAppConfig() *AppConfig {
return &AppConfig{
Log: log.NewConfig(),
Auth: authkit.NewConfig(),
Log: log.NewConfig(log.WithKeyPrefix("log")),
Auth: authkit.NewConfig(authkit.WithKeyPrefix("auth")),
}
}

Expand Down
Loading