Skip to content

Commit

Permalink
Merge pull request #120 from apigee/Issue112
Browse files Browse the repository at this point in the history
Keystores
  • Loading branch information
ssvaidyanathan authored Apr 30, 2021
2 parents 00a6192 + 8a0e3a3 commit d92cf1f
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 128 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ mvn install -Ptest -Dapigee.config.options=create
exportAppKeys
reports
references
keystores
For example, the apps goal is used below to only create apps and ignore all other config types.
mvn apigee-config:apps -Ptest -Dapigee.config.options=create
Expand All @@ -100,6 +100,7 @@ This project demonstrates the creation and management of Apigee Edge Config and
- Creates Developer Apps
- Creates Custom Reports
- Creates References
- Creates Keystores
and many more

To use, edit samples/EdgeConfig/shared-pom.xml, and update org, env to point to your Apigee org and env respectively and path of service account credentials elements in all profiles. You can add more profiles corresponding to each env in your org.
Expand Down Expand Up @@ -142,7 +143,7 @@ The apigee.config.dir option must be used to identify the top most directory con
│   ├── test
│   │ ├── kvms.json
│   │ ├── targetServers.json
│   │ ├── targetServers.json
│   │ ├── keystores.json
│ └── references.json
└── org
├── apiProducts.json
Expand Down Expand Up @@ -175,6 +176,7 @@ The final level is the config entities.
orgConfig.developerApps[]
orgConfig.reports[]
envConfig.test.targetServers[]
envConfig.test.keystores[]
envConfig.test.references[]
```

Expand Down
268 changes: 144 additions & 124 deletions samples/APIandConfig/HelloWorld/edge.json
Original file line number Diff line number Diff line change
@@ -1,133 +1,153 @@
{
"version": "1.0",
"envConfig": {
"test": {
"targetServers": [
{
"name" : "HTTPBin",
"host" : "httpbin.org",
"isEnabled" : true,
"port" : 80
}
],
"references": [
{
"name" : "sampleReference",
"refers": "freetrial-2019-03-07",
"resourceType": "KeyStore"
}
],
"resourcefiles":[
{
"name": "test",
"type": "jsc",
"file": "./resourceFiles/jsc/test.js"
}
],
"flowhooks":[
{
"name":"PreProxyFlowHook",
"continueOnError":"true",
"sharedFlow":"corspreflow"
},
{
"name":"PreTargetFlowHook",
"continueOnError":"true",
"sharedFlow":"corspreflow"
}
]
}
},
"orgConfig": {
"apiProducts": [
"version":"1.0",
"envConfig":{
"test":{
"targetServers":[
{
"name": "EchoProduct",
"apiResources": [
"/",
"/**"
],
"approvalType": "auto",
"attributes": [
{
"name": "description",
"value": "Echo Product"
}
],
"description": "Echo Product",
"displayName": "Echo Product",
"environments": [
"test",
"prod"
],
"proxies": [
"HelloWorld"
],
"quota": "10000",
"quotaInterval": "1",
"quotaTimeUnit": "month",
"scopes": []
}
],
"reports": [
{
"displayName": "Policy errors",
"chartType": "line",
"properties": [
{
"property": "__ui__",
"value": [
{
"name": "description",
"value": "This report shows the total number policy errors for API proxies. Proxies with zero errors are not shown."
} ]
}
],
"metrics": [
{
"function": "sum",
"name": "policy_error"
}
],
"dimensions": [
"apiproxy"
],
"filter": "(policy_error gt 0)",
"timeUnit": "hour"
}
],
"developers": [
"name":"HTTPBin",
"host":"httpbin.org",
"isEnabled":true,
"port":80
}
],
"references":[
{
"name":"sampleReference",
"refers":"freetrial-2019-03-07",
"resourceType":"KeyStore"
}
],
"resourcefiles":[
{
"email": "[email protected]",
"firstName": "John",
"lastName": "Example",
"userName": "johnexample",
"attributes": []
"name":"test",
"type":"jsc",
"file":"./resourceFiles/jsc/test.js"
}
],
"keystores":[
{
"name":"testKeyStorename"
}
],
"flowhooks":[
{
"name":"PreProxyFlowHook",
"continueOnError":"true",
"sharedFlow":"corspreflow"
},
{
"email": "[email protected]",
"firstName": "Bill",
"lastName": "Buffalo",
"userName": "billunesco",
"attributes": []
"name":"PreTargetFlowHook",
"continueOnError":"true",
"sharedFlow":"corspreflow"
}
],
"developerApps": {
"[email protected]": [
{
"name": "coolechoapp",
"apiProducts": [ "EchoProduct" ],
"callbackUrl": "http://weatherapp.com",
"scopes": []
}
]
}
},
"orgConfig":{
"apiProducts":[
{
"name":"EchoProduct",
"apiResources":[
"/",
"/**"
],
"approvalType":"auto",
"attributes":[
{
"name":"description",
"value":"Echo Product"
}
],
"description":"Echo Product",
"displayName":"Echo Product",
"environments":[
"test",
"prod"
],
"[email protected]": [
{
"name": "oneechoapp",
"apiProducts": [ "EchoProduct" ],
"callbackUrl": "http://weatherapp.com",
"scopes": []
}
"proxies":[
"HelloWorld"
],
"quota":"10000",
"quotaInterval":"1",
"quotaTimeUnit":"month",
"scopes":[

]
}
],
"reports":[
{
"displayName":"Policy errors",
"chartType":"line",
"properties":[
{
"property":"__ui__",
"value":[
{
"name":"description",
"value":"This report shows the total number policy errors for API proxies. Proxies with zero errors are not shown."
}
]
}
],
"metrics":[
{
"function":"sum",
"name":"policy_error"
}
],
"dimensions":[
"apiproxy"
],
"filter":"(policy_error gt 0)",
"timeUnit":"hour"
}
],
"developers":[
{
"email":"[email protected]",
"firstName":"John",
"lastName":"Example",
"userName":"johnexample",
"attributes":[

]
}
}
},
{
"email":"[email protected]",
"firstName":"Bill",
"lastName":"Buffalo",
"userName":"billunesco",
"attributes":[

]
}
],
"developerApps":{
"[email protected]":[
{
"name":"coolechoapp",
"apiProducts":[
"EchoProduct"
],
"callbackUrl":"http://weatherapp.com",
"scopes":[

]
}
],
"[email protected]":[
{
"name":"oneechoapp",
"apiProducts":[
"EchoProduct"
],
"callbackUrl":"http://weatherapp.com",
"scopes":[

]
}
]
}
}
}
9 changes: 8 additions & 1 deletion samples/APIandConfig/shared-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<plugin>
<groupId>io.apigee.build-tools.enterprise4g</groupId>
<artifactId>apigee-edge-maven-plugin</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<executions>
<execution>
<id>configure-bundle-step</id>
Expand Down Expand Up @@ -85,6 +85,13 @@
<goal>targetservers</goal>
</goals>
</execution>
<execution>
<id>create-config-keystores</id>
<phase>verify</phase>
<goals>
<goal>keystores</goal>
</goals>
</execution>
<execution>
<id>create-config-resourcefiles</id>
<phase>install</phase>
Expand Down
5 changes: 5 additions & 0 deletions samples/EdgeConfig/resources/edge/env/test/keystores.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"name" : "testKeyStorename"
}
]
9 changes: 8 additions & 1 deletion samples/EdgeConfig/shared-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<plugin>
<groupId>com.apigee.edge.config</groupId>
<artifactId>apigee-config-maven-plugin</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<executions>
<execution>
<id>create-config-references</id>
Expand All @@ -49,6 +49,13 @@
<goal>keyvaluemaps</goal>
</goals>
</execution>
<execution>
<id>create-config-keystores</id>
<phase>install</phase>
<goals>
<goal>keystores</goal>
</goals>
</execution>
<execution>
<id>create-config-resourcefiles</id>
<phase>install</phase>
Expand Down
Loading

0 comments on commit d92cf1f

Please sign in to comment.