Skip to content

Commit 37624bd

Browse files
committed
Minor refactoring and updates of documentations for Dec Minor version release
1 parent 447c39d commit 37624bd

File tree

12 files changed

+300
-252
lines changed

12 files changed

+300
-252
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
### V1.0-SNAPSHOT
55
+ Initial release with HMAC256 and RSA256 signing utility
66
### V1.0.1-SNAPSHOT
7-
+ Enhancement for Issue #1 - ApiList sorting is not based on key first then value
7+
+ Enhancement for Issue #1 - ApiList sorting is not based on key first then value
8+
### V1.1.0-SNAPSHOT
9+
+ Minor refactoring
10+
+ Update interface name so as be intuitive
11+
+ Update corresponding test cases
12+
+ Include Issue/PR templates
13+
+ Include Contribution template

CONTRIBUTION.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Contributing:
2+
We welcome your involvement, be it fixing bugs or implementing new features that you find relevant to this library.
3+
4+
To contribute, you may follow the steps below:
5+
1. Fork the repo
6+
2. Create a new branch from `development` to work on your contribution
7+
3. Create a pull request back when you are done
8+
9+
Please refer to the ISSUES and PULL REQUEST templates when raising them.
10+
11+
You can raise an issue within this Github repository to kick-start the discussion first.

ISSUE_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Expected Behavior
2+
3+
Please describe the behavior you are expecting
4+
5+
# Current Behavior
6+
7+
What is the current behavior?
8+
9+
# Failure Information (for bugs)
10+
11+
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template and label it as **enhancement**
12+
13+
## Steps to Reproduce
14+
15+
Please provide detailed steps for reproducing the issue.
16+
17+
1. step 1
18+
2. step 2
19+
3. and so on...
20+
21+
## Context
22+
23+
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
24+
25+
26+
## Failure Logs
27+
28+
Please include any relevant log snippets or files here.

PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue number)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
Please describe or list the test cases that you ran to verify your changes, and provide instructions so we can reproduce.
19+

README.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ formList.add("param1", "data1");
137137
String baseString;
138138

139139
try {
140-
baseString = ApiAuthorization.getBaseString(
140+
baseString = ApiSigning.getBaseString(
141141
"<<authPrefix>>",
142142
"HMACSHA256",
143143
"<<appId>>",
@@ -159,7 +159,7 @@ System.out.println(baseString);
159159
##### Preparing L1 Security Signature :
160160

161161
Method:
162-
* getL1Signature
162+
* getHMACSignature
163163

164164
Params:
165165
* baseString
@@ -171,7 +171,7 @@ String secret = "<<appSecret>>";
171171
String L1Sig;
172172

173173
try {
174-
L1Sig = ApiAuthorization.getL1Signature(baseString, secret);
174+
L1Sig = ApiSigning.getHMACSignature(baseString, secret);
175175
System.out.println(L1Sig);
176176

177177
} catch (ApiUtilException e) {
@@ -183,7 +183,7 @@ try {
183183
##### Preparing L2 Security Signature :
184184

185185
Method:
186-
* getL2Signature
186+
* getRSASignature
187187

188188
Params:
189189
* baseString
@@ -198,14 +198,14 @@ String publicCertFileName = "certificates/ssc.alpha.example.com.cer";
198198

199199
try {
200200

201-
PrivateKey privateKey = ApiAuthorization.getPrivateKeyFromKeyStore(keyStoreFileName, password, alias);
201+
PrivateKey privateKey = ApiSigning.getPrivateKeyFromKeyStore(keyStoreFileName, password, alias);
202202

203-
String signature = ApiAuthorization.getL2Signature(baseString, privateKey);
203+
String signature = ApiSigning.getRSASignature(baseString, privateKey);
204204

205205
System.out.println(expectedSignature);
206206
System.out.println(signature);
207207

208-
PublicKey publicKey = ApiAuthorization.getPublicKeyFromX509Certificate(publicCertFileName);
208+
PublicKey publicKey = ApiSigning.getPublicKeyFromX509Certificate(publicCertFileName);
209209

210210
} catch (ApexUtilLibException e) {
211211
e.printStackTrace();
@@ -241,23 +241,17 @@ String nonce = null;
241241
String timestamp = null;
242242

243243
try {
244-
String signature = ApiAuthorization.getToken("http://api.test.io/l2", "<<authPrefix>>", "get", url, appId, null, null, password, alias, certFileName, nonce, timestamp);
244+
String signature = ApiSigning.getToken("http://api.test.io/l2", "<<authPrefix>>", "get", url, appId, null, null, password, alias, certFileName, nonce, timestamp);
245245
} catch (ApiUtilException e) {
246246
e.printStackTrace();
247247
}
248248
```
249-
### Release:
250-
+ Checkout CHANGELOG.md for releases
251-
252-
### Contributing:
253-
We welcome your involvement, be it fixing bugs or implementing new features that you find relevant to this library.
254249

255-
To contribute, you may follow the steps below:
256-
1. Fork the repo
257-
2. Create a new branch from `development` to work on your contribution
258-
3. Create a pull request back when you are done
250+
### Contributing
251+
+ Check out CONTRIBUTION.md
259252

260-
Alternatively, you can raise an issue within this Github repository.
253+
### Release:
254+
+ Checkout CHANGELOG.md for releases
261255

262256
### Reference:
263257
+ [UTF-8 in Gradle](https://stackoverflow.com/questions/21267234/show-utf-8-text-properly-in-gradle)

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'com.github.kt3k.coveralls' version '2.6.3'
55
}
66

7-
version '1.0.1-SNAPSHOT'
7+
version '1.1.0-SNAPSHOT'
88

99
tasks.withType(JavaCompile) {
1010
options.encoding = "UTF-8"
@@ -29,7 +29,7 @@ jar {
2929
}
3030
}
3131
manifest {
32-
attributes 'Main-Class': 'ApiAuthorization'
32+
attributes 'Main-Class': 'ApiSigning'
3333
}
3434
}
3535

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.api.util</groupId>
44
<artifactId>ApiSecurity</artifactId>
5-
<version>1.0.1-SNAPSHOT</version>
5+
<version>1.1.0-SNAPSHOT</version>
66
<build>
77
<plugins>
88
<plugin>

0 commit comments

Comments
 (0)