From 1b3bfbca8f28d974af45258a8cb463f184739a48 Mon Sep 17 00:00:00 2001 From: Jakub Bielecki Date: Thu, 6 Oct 2022 09:26:30 +0200 Subject: [PATCH] docs: comment syntax godoc-compatible The godoc and pkg.go.dev do not use Markdown and do not understand asterix nor backtick. With this change, documentation renders correctly. Adding a badge to the README, so that it would be easy to get the dev's documentation when visiting GitHub with just a browser. --- README.md | 2 ++ ginjwt/helpers.go | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ae8cccd..a0424cc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Go Reference](https://pkg.go.dev/badge/go.hollow.sh/toolbox.svg)](https://pkg.go.dev/go.hollow.sh/toolbox) + # Hollow Toolbox This repository contains the following shared packages that are used throughout the Hollow eco-system. diff --git a/ginjwt/helpers.go b/ginjwt/helpers.go index 9228661..66dd8f1 100644 --- a/ginjwt/helpers.go +++ b/ginjwt/helpers.go @@ -28,22 +28,26 @@ type Claims struct { // RegisterViperOIDCFlags ensures that the given Viper and cobra.Command instances // have the following command line/configuration flags registered: // -// * `oidc`: Enables/disables OIDC Authentication +// - oidc: Enables/disables OIDC authentication. +// +// - oidc-aud: Specifies the expected audience for the JWT token. +// +// - oidc-issuer: Specifies the expected issuer for the JWT token (can be more than one value). +// +// - oidc-jwksuri: Specifies the JSON Web Key Set (JWKS) URI (can be more than one value). +// +// - oidc-roles-claim: Specifies the roles to be accepted for the JWT claim. +// +// - oidc-username-claim: Specifies a username to use for the JWT claim. +// +// - oidc-jwks-remotetimeout: Specifies a timeout for the JWKS URI. // // A call to this would normally look as follows: // // ginjwt.RegisterViperOIDCFlags(viper.GetViper(), serveCmd) // // The oidc configuration should be passed in through a yaml file due to the nested -// structure of the fields, however, if only one oidc provider is used the flag parameters would work -// -// * `oidc-aud`: Specifies the expected audience for the JWT token -// * `oidc-issuer`: Specifies the expected issuer for the JWT token (can be more than one value) -// * `oidc-jwksuri`: Specifies the JSON Web Key Set (JWKS) URI (can be more than one value). -// * `oidc-roles-claim`: Specifies the roles to be accepted for the JWT claim. -// * `oidc-username-claim`: Specifies a username to use for the JWT claim -// * `oidc-jwks-remotetimeout`: Specifies a timeout for the JWKS URI -// +// structure of the fields, however, if only one oidc provider is used the flag parameters would work. func RegisterViperOIDCFlags(v *viper.Viper, cmd *cobra.Command) { cmd.Flags().Bool("oidc", true, "use oidc auth") ViperBindFlag("oidc.enabled", cmd.Flags().Lookup("oidc"))