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

191 support for portal apis #193

Merged
merged 11 commits into from
Nov 22, 2023
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>com.apigee.edge.config</groupId>
<artifactId>apigee-config-maven-plugin</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>apigee-config-maven-plugin</name>
<description>Plugin to manage configuration in Apigee</description>
Expand Down
104 changes: 76 additions & 28 deletions samples/APIandConfig/HelloWorld/edge.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"description":"Echo Product",
"attributes":[
{
"name": "access",
"value": "public"
"name":"access",
"value":"public"
}
],
"environments":[
Expand All @@ -91,33 +91,35 @@
"quota":"10000",
"quotaInterval":"1",
"quotaTimeUnit":"month",
"operationGroup": {
"operationConfigs": [
{
"apiSource": "HelloWorld",
"operations": [
{
"resource": "/",
"methods": [
"GET"
]
}
"operationGroup":{
"operationConfigs":[
{
"apiSource":"HelloWorld",
"operations":[
{
"resource":"/",
"methods":[
"GET"
]
}
],
"quota": {
"limit": "1000",
"interval": "1",
"timeUnit": "month"
"quota":{
"limit":"1000",
"interval":"1",
"timeUnit":"month"
},
"attributes": [
{
"name": "foo",
"value": "bar"
}
"attributes":[
{
"name":"foo",
"value":"bar"
}
]
}
}
]
},
"scopes":[]
},
"scopes":[

]
},
{
"name":"EchoProduct-legacy",
Expand All @@ -132,8 +134,8 @@
"value":"Echo Product Legacy"
},
{
"name": "access",
"value": "public"
"name":"access",
"value":"public"
}
],
"description":"Echo Product Legacy",
Expand All @@ -148,7 +150,9 @@
"quota":"10000",
"quotaInterval":"1",
"quotaTimeUnit":"month",
"scopes":[]
"scopes":[

]
}
],
"kvms":[
Expand Down Expand Up @@ -253,6 +257,50 @@
}
]
},
"apiCategories":[
"echo",
"sample",
"foo"
],
"apiDocs":[
{
"title":"Sample Doc",
"description":"Sample description",
"anonAllowed":true,
"imageUrl":"",
"requireCallbackUrl":true,
"published":true,
"apiProductName":"weatherProduct",
"categories":[
"foo"
],
"oasDocumentation":{
"spec":{
"displayName":"sample-doc-spec",
"file":"./specs/openapi.yaml"
}
}
},
{
"title":"Sample GQL",
"description":"Sample GraphQL",
"anonAllowed":true,
"imageUrl":"",
"requireCallbackUrl":true,
"published":true,
"apiProductName":"demo",
"categories":[
"bar"
],
"graphqlDocumentation":{
"schema":{
"displayName":"sample-doc-spec",
"file":"./specs/schema.graphql"
},
"endpointUri":"https://demo.google.com/graphql"
}
}
],
"importKeys":{
"[email protected]":[
{
Expand Down
144 changes: 144 additions & 0 deletions samples/APIandConfig/HelloWorld/specs/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
openapi: 3.0.0
info:
description: OpenAPI Specification for the Apigee mock target service endpoint.
version: 1.0.0
title: Mock Target API
paths:
/:
get:
summary: View personalized greeting
operationId: View a personalized greeting
description: View a personalized greeting for the specified or guest user.
parameters:
- name: user
in: query
description: Your user name.
required: false
schema:
type: string
responses:
"200":
description: Success
/help:
get:
summary: Get help
operationId: Get help
description: View help information about available resources in HTML format.
responses:
"200":
description: Success
/user:
get:
summary: View personalized greeting
operationId: View personalized greeting
description: View a personalized greeting for the specified or guest user.
parameters:
- name: user
in: query
description: Your user name.
required: false
schema:
type: string
responses:
"200":
description: Success
/iloveapis:
get:
summary: View API affirmation
operationId: View API affirmation
description: View API affirmation in HTML format.
responses:
"200":
description: Success
/ip:
get:
summary: View IP address
operationId: View IP address
description: View the IP address of the client in JSON format.
responses:
"200":
description: Success
/xml:
get:
summary: View XML response
operationId: View XML response
description: View a sample response in XML format.
responses:
"200":
description: Success
/json:
get:
summary: View JSON response
operationId: View JSON response
description: View a sample response in JSON format.
responses:
"200":
description: Success
/echo:
get:
summary: View request headers and body
operationId: View request headers and body
description: View the request headers and body in JSON format.
responses:
"200":
description: Success
post:
summary: Send request and view request headers and body
operationId: Send request and view request headers and body
description: "Send a request and view the resulting request headers and body in JSON
format.
The request payload can be specified using one of the
following formats: application/json, application/x-www-form-urlencoded,
or application/xml."
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/request-body"
description: Request payload in application/json,
application/x-www-form-urlencoded, or application/xml format.
required: true
responses:
"200":
description: Success
"/statuscode/{code}":
get:
summary: View status code and message
operationId: View status code and message
description: View status code and message for the specified value.
parameters:
- name: code
in: path
description: HTTP status code.
required: true
schema:
type: string
responses:
"200":
description: Success
/auth:
get:
security:
- basicAuth: []
summary: Validate access using basic authentication
operationId: Validate access using basic authentication
description: Validate access using basic authentication.
responses:
"200":
description: Success
servers:
- url: http://mocktarget.apigee.net
- url: https://mocktarget.apigee.net
components:
securitySchemes:
basicAuth:
type: http
description: HTTP Basic Authentication.
scheme: basic
schemas:
request-body:
properties:
replace-me:
type: object
description: Replace with request payload in application/json,
application/x-www-form-urlencoded, or application/xml format.
12 changes: 12 additions & 0 deletions samples/APIandConfig/HelloWorld/specs/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type Query {
greeting:String
students:[Student]
}

type Student {
id:ID!
firstName:String
lastName:String
password:String
collegeId:String
}
18 changes: 17 additions & 1 deletion samples/APIandConfig/shared-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<plugin>
<groupId>com.apigee.edge.config</groupId>
<artifactId>apigee-config-maven-plugin</artifactId>
<version>2.5.0</version>
<version>2.6.0-SNAPSHOT</version>
<executions>
<execution>
<id>create-config-targetserver</id>
Expand Down Expand Up @@ -148,6 +148,20 @@
<goal>importKeys</goal>
</goals>
</execution>
<execution>
<id>create-portal-categories</id>
<phase>install</phase>
<goals>
<goal>apicategories</goal>
</goals>
</execution>
<execution>
<id>create-portal-docs</id>
<phase>install</phase>
<goals>
<goal>apidocs</goal>
</goals>
</execution>
</executions>
</plugin>

Expand All @@ -165,6 +179,7 @@
<apigee.authtype>oauth</apigee.authtype> <!-- only option -->
<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
<apigee.serviceaccount.file>${file}</apigee.serviceaccount.file>
<apigee.portal.siteId>${siteId}</apigee.portal.siteId> <!-- Apigee Portal Site ID -->
<apigee.options>override</apigee.options>
</properties>
</profile>
Expand All @@ -179,6 +194,7 @@
<apigee.authtype>oauth</apigee.authtype> <!-- only option -->
<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
<apigee.serviceaccount.file>${file}</apigee.serviceaccount.file>
<apigee.portal.siteId>${siteId}</apigee.portal.siteId> <!-- Apigee Portal Site ID -->
<apigee.options>override</apigee.options>
</properties>
</profile>
Expand Down
4 changes: 4 additions & 0 deletions samples/EdgeConfig/resources/edge/org/apiCategories.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"foo",
"bar"
]
Loading