Fix override clients bug (#23)

This commit is contained in:
Jakub Kabza
2019-09-19 09:29:18 +02:00
committed by Tomasz Smelcerz
parent 294c171ac6
commit 22988c0db6
7 changed files with 184 additions and 69 deletions

View File

@ -16,6 +16,8 @@ limitations under the License.
package v1alpha1
import (
"fmt"
"github.com/ory/hydra-maester/hydra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@ -110,10 +112,10 @@ func init() {
// ToOAuth2ClientJSON converts an OAuth2Client into a OAuth2ClientJSON object that represents an OAuth2 client digestible by ORY Hydra
func (c *OAuth2Client) ToOAuth2ClientJSON() *hydra.OAuth2ClientJSON {
return &hydra.OAuth2ClientJSON{
Name: c.Name,
GrantTypes: grantToStringSlice(c.Spec.GrantTypes),
ResponseTypes: responseToStringSlice(c.Spec.ResponseTypes),
Scope: c.Spec.Scope,
Owner: fmt.Sprintf("%s/%s", c.Name, c.Namespace),
}
}