Skip to content

Commit

Permalink
Merge pull request #121 from apigee/Issue113
Browse files Browse the repository at this point in the history
Aliases
  • Loading branch information
ssvaidyanathan authored Apr 30, 2021
2 parents d92cf1f + 537845a commit eba9452
Show file tree
Hide file tree
Showing 7 changed files with 542 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ mvn install -Ptest -Dapigee.config.options=create
reports
references
keystores
aliases
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 @@ -101,6 +102,7 @@ This project demonstrates the creation and management of Apigee Edge Config and
- Creates Custom Reports
- Creates References
- Creates Keystores
- Creates Aliases
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 @@ -144,7 +146,8 @@ The apigee.config.dir option must be used to identify the top most directory con
│   │ ├── kvms.json
│   │ ├── targetServers.json
│   │ ├── keystores.json
│ └── references.json
│   │ ├── aliases.json
│ │ └── references.json
└── org
├── apiProducts.json
├── developerApps.json
Expand Down Expand Up @@ -178,6 +181,7 @@ The final level is the config entities.
envConfig.test.targetServers[]
envConfig.test.keystores[]
envConfig.test.references[]
envConfig.test.aliases[]
```

Each config entity is the payload of the corresponding management API. The example project may not show all the attributes of config entities, but any valid input of a management API would work.
Expand Down
28 changes: 28 additions & 0 deletions samples/APIandConfig/HelloWorld/edge.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,34 @@
"name":"testKeyStorename"
}
],
"aliases":[
{
"alias":"testSelfSignedCert",
"keystorename":"testKeyStorename",
"format":"selfsignedcert",
"keySize":"2048",
"sigAlg":"SHA256withRSA",
"subject":{
"commonName":"testcommonName"
},
"certValidityInDays":"90"
},
{
"alias":"testAliasKeyCertFileAndKey",
"keystorename":"testKeyStorename",
"format":"keycertfile",
"certFilePath":"/tmp/certs/keystore.pem",
"keyFilePath":"/tmp/certs/keystore.key",
"password":"dummy"
},
{
"alias":"testAliasPKCS12",
"keystorename":"testKeyStorename",
"format":"pkcs12",
"filePath":"/tmp/certs/myKeystore.p12",
"password":"dummy"
}
],
"flowhooks":[
{
"name":"PreProxyFlowHook",
Expand Down
7 changes: 7 additions & 0 deletions samples/APIandConfig/shared-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
<goal>keystores</goal>
</goals>
</execution>
<execution>
<id>create-config-aliases</id>
<phase>verify</phase>
<goals>
<goal>aliases</goal>
</goals>
</execution>
<execution>
<id>create-config-resourcefiles</id>
<phase>install</phase>
Expand Down
28 changes: 28 additions & 0 deletions samples/EdgeConfig/resources/edge/env/test/aliases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"alias":"testSelfSignedCert",
"keystorename": "testKeyStorename",
"format": "selfsignedcert",
"keySize":"2048",
"sigAlg":"SHA256withRSA",
"subject":{
"commonName":"testcommonName"
},
"certValidityInDays":"90"
},
{
"alias":"testAliasKeyCertFileAndKey",
"keystorename": "testKeyStorename",
"format": "keycertfile",
"certFilePath":"/tmp/certs/keystore.pem",
"keyFilePath":"/tmp/certs/keystore.key",
"password":"dummy"
},
{
"alias":"testAliasPKCS12",
"keystorename": "testKeyStorename",
"format": "pkcs12",
"filePath":"/tmp/certs/myKeystore.p12",
"password":"dummy"
}
]
7 changes: 7 additions & 0 deletions samples/EdgeConfig/shared-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
<goal>keystores</goal>
</goals>
</execution>
<execution>
<id>create-config-aliases</id>
<phase>install</phase>
<goals>
<goal>aliases</goal>
</goals>
</execution>
<execution>
<id>create-config-resourcefiles</id>
<phase>install</phase>
Expand Down
Loading

0 comments on commit eba9452

Please sign in to comment.