From f9fe5ae3cbb24b37135f2004f81ebf047afe45b0 Mon Sep 17 00:00:00 2001 From: Simon Murray Date: Fri, 28 Jun 2024 09:12:30 +0100 Subject: [PATCH] Fix Oauth2 Provider SIGSEGV (#89) --- charts/identity/Chart.yaml | 4 ++-- pkg/handler/oauth2providers/client.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/identity/Chart.yaml b/charts/identity/Chart.yaml index 3d8f43e7..132490bf 100644 --- a/charts/identity/Chart.yaml +++ b/charts/identity/Chart.yaml @@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's IdP type: application -version: v0.2.17 -appVersion: v0.2.17 +version: v0.2.18 +appVersion: v0.2.18 icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png diff --git a/pkg/handler/oauth2providers/client.go b/pkg/handler/oauth2providers/client.go index 57505048..6bce8abe 100644 --- a/pkg/handler/oauth2providers/client.go +++ b/pkg/handler/oauth2providers/client.go @@ -67,16 +67,18 @@ func (c *Client) get(ctx context.Context, organization *organizations.Meta, prov } func convert(permissions *rbac.Permissions, in *unikornv1.OAuth2Provider) *openapi.Oauth2ProviderRead { - t := openapi.Oauth2ProviderType(*in.Spec.Type) - out := &openapi.Oauth2ProviderRead{ Metadata: conversion.OrganizationScopedResourceReadMetadata(in, coreopenapi.ResourceProvisioningStatusProvisioned), Spec: openapi.Oauth2ProviderSpec{ - Type: &t, ClientID: in.Spec.ClientID, }, } + if in.Spec.Type != nil { + t := openapi.Oauth2ProviderType(*in.Spec.Type) + out.Spec.Type = &t + } + // Only show sensitive details for organizations you are an admin of. if showDetails(permissions) { out.Spec.ClientSecret = in.Spec.ClientSecret