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

Feature/protected-externally #985

Merged
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
1 change: 1 addition & 0 deletions src/batch/data-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ const metadata = {
type: 'enum',
values: [
'public',
'protected-externally',
'authorization-code',
'client-credentials',
'kong-acl-only',
Expand Down
1 change: 1 addition & 0 deletions src/controllers/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ components:
type: string
enum:
- public
- protected-externally
- authorization-code
- client-credentials
- kong-acl-only
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/v2/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ const models: TsoaRoute.Models = {
"name": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["dev"]},{"dataType":"enum","enums":["test"]},{"dataType":"enum","enums":["prod"]},{"dataType":"enum","enums":["sandbox"]},{"dataType":"enum","enums":["other"]}]},
"active": {"dataType":"boolean"},
"approval": {"dataType":"boolean"},
"flow": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["public"]},{"dataType":"enum","enums":["authorization-code"]},{"dataType":"enum","enums":["client-credentials"]},{"dataType":"enum","enums":["kong-acl-only"]},{"dataType":"enum","enums":["kong-api-key-only"]},{"dataType":"enum","enums":["kong-api-key-acl"]}]},
"flow": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["public"]},{"dataType":"enum","enums":["protected-externally"]},{"dataType":"enum","enums":["authorization-code"]},{"dataType":"enum","enums":["client-credentials"]},{"dataType":"enum","enums":["kong-acl-only"]},{"dataType":"enum","enums":["kong-api-key-only"]},{"dataType":"enum","enums":["kong-api-key-acl"]}]},
"additionalDetailsToRequest": {"dataType":"string"},
"services": {"dataType":"array","array":{"dataType":"refAlias","ref":"GatewayServiceRefID"}},
"legal": {"ref":"LegalRefID"},
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/v2/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export interface Environment {
name?: "dev" | "test" | "prod" | "sandbox" | "other";
active?: boolean;
approval?: boolean;
flow?: "public" | "authorization-code" | "client-credentials" | "kong-acl-only" | "kong-api-key-only" | "kong-api-key-acl";
flow?: "public" | "protected-externally" | "authorization-code" | "client-credentials" | "kong-acl-only" | "kong-api-key-only" | "kong-api-key-acl";
additionalDetailsToRequest?: string;
services?: GatewayServiceRefID[];
legal?: LegalRefID;
Expand Down
1 change: 1 addition & 0 deletions src/lists/Environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = {
defaultValue: 'public',
options: [
{ value: 'public', label: 'Public' },
{ value: 'protected-externally', label: 'Protected Externally' },
{
value: 'authorization-code',
label: 'Oauth2 Authorization Code Flow',
Expand Down
9 changes: 6 additions & 3 deletions src/nextapp/components/api-product-item/api-product-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const ApiProductItem: React.FC<ApiProductItemProps> = ({
id,
preview,
}) => {
const isProtected = data.environments.some((e) => e.flow !== 'public');
const isPublic = data.environments.some((e) => e.flow === 'public');
const isGatewayProtected = data.environments.some(
(e) => e.flow !== 'public' && e.flow !== 'protected-externally'
);
const isTiered = data.environments.some((e) => e.anonymous);

return (
Expand All @@ -49,7 +52,7 @@ const ApiProductItem: React.FC<ApiProductItemProps> = ({
<Flex align="center" mb={2}>
<Flex align="center" width={8}>
<Icon
as={!isProtected || isTiered ? RiEarthFill : FaLock}
as={isPublic || isTiered ? RiEarthFill : FaLock}
color="bc-blue"
boxSize="5"
/>
Expand All @@ -63,7 +66,7 @@ const ApiProductItem: React.FC<ApiProductItemProps> = ({
)}
</GridItem>
</Grid>
{!isTiered && isProtected && (
{!isTiered && isGatewayProtected && (
<AccessRequestForm
disabled={false}
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,5 @@ const flowTypes: { value: string; label: string }[] = [
{ value: 'kong-acl-only', label: 'Kong ACL Only' },
{ value: 'kong-api-key-only', label: 'Kong API Key Only' },
{ value: 'kong-api-key-acl', label: 'Kong API Key with ACL Flow' },
{ value: 'protected-externally', label: 'Protected Externally' },
];
1 change: 1 addition & 0 deletions src/nextapp/shared/services/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const getAuthToken = (method: string): IconType => {
export const getFlowText = (key: string): string => {
const dict = {
public: 'Public',
'protected-externally': 'Protected Externally',
'authorization-code': 'OAuth2 Authorization Code Flow',
'client-credentials': 'OAuth2 Client Credentials Flow',
'kong-acl-only': 'Kong ACL Only',
Expand Down
Loading