Hide "Request API Key" in Cataloge not working as expected?

We’re trying to set up the developer portal and have some trouble hiding the “Request API Key” button on APIs that do not have access control.

The template in portal/templates/catalogue.html shows the following snippet

{{if eq $apiDetail.Version "" }}
{{if eq $apiDetail.IsKeyless false}}
	<a href="{{if $page.PortalConfig.EnableMultiSelection}}{{ $page.PortalRoot }}member/apis/request?policy_id={{$apiDetail.APIID}}{{else}}{{ $page.PortalRoot }}member/apis/{{$apiDetail.APIID}}/request{{end}}" class="btn btn-success catalogue">
	<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span>&nbsp; Request an API key
	</a>
{{ end }}
{{ else }}
{{if eq $apiDetail.IsKeyless false}}
	<a href="{{if $page.PortalConfig.EnableMultiSelection}}{{ $page.PortalRoot }}member/policies/request?policy_id={{$apiDetail.PolicyID}}{{else}}{{ $page.PortalRoot }}member/policies/{{$apiDetail.PolicyID}}/request{{end}}" class="btn btn-success catalogue">
	<span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span>&nbsp; Request an API key
</a>
{{ end }}

If I understand that markup correctly, the button should now be displayed if the API is configured to be keyless. However, in our case it always shows up, no matter if it’s keyless, auth token or something else.

Hi @markus.wiedmer, we have a bug in the portal catalogue where the keyless APIs have is_keyless always set to false. To fix the issue, could you manually set the value in the MongoDB collection portal_catalogue to true and let us know the result.

1 Like