Skip to content

Commit

Permalink
fix: invalid value for year when calling ghsa (#34)
Browse files Browse the repository at this point in the history
* fix: Invalid value for Year when calling ghsa
Removed unused code that was causing an exception

* chore: version 2.0.1
  • Loading branch information
jeremylong authored Feb 21, 2023
1 parent cece0be commit b4a29d4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 2.0.1 - 2023-02-21

### Fixed

- Resolved issue with the vulnz cli error trying to access GHSA ([#34](https://github.com/jeremylong/vuln-tools/pull/34)).

## 2.0.0 - 2023-02-18

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group 'io.github.jeremylong'
version = '2.0.0'
version = '2.0.1'

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions gh-advisory-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ The client requires a GitHub Personal Access Token to access the API.
<dependency>
<groupId>io.github.jeremylong</groupId>
<artifactId>gh-advisory-lib</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

### gradle

```groovy
implementation 'io.github.jeremylong:gh-advisory-lib:2.0.0'
implementation 'io.github.jeremylong:gh-advisory-lib:2.0.1'
```

### building from source
Expand Down
4 changes: 2 additions & 2 deletions nvd-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Vulnerability Catalog can be downloaded in ~90 seconds.
<dependency>
<groupId>io.github.jeremylong</groupId>
<artifactId>nvd-lib</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</dependency>
```

### gradle

```groovy
implementation 'io.github.jeremylong:nvd-lib:2.0.0'
implementation 'io.github.jeremylong:nvd-lib:2.0.1'
```

### building from source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.springframework.stereotype.Component;
import picocli.CommandLine;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Collection;

Expand Down Expand Up @@ -106,7 +104,6 @@ public Integer timedCall() throws Exception {
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);

JsonFactory jfactory = objectMapper.getFactory();
// JsonFactory jfactory = new JsonFactory();
JsonGenerator jsonOut = jfactory.createGenerator(System.out, JsonEncoding.UTF8);
if (isPrettyPrint()) {
jsonOut.useDefaultPrettyPrinter();
Expand All @@ -117,7 +114,6 @@ public Integer timedCall() throws Exception {
jsonOut.writeStartArray();
CveOutput output = new CveOutput();
try (GitHubSecurityAdvisoryClient api = builder.build()) {
ZonedDateTime lastModified = ZonedDateTime.ofInstant(Instant.MIN, ZoneId.of("UTC"));
while (api.hasNext()) {
Collection<SecurityAdvisory> list = api.next();
if (list != null) {
Expand All @@ -126,14 +122,12 @@ public Integer timedCall() throws Exception {
for (SecurityAdvisory c : list) {
jsonOut.writeObject(c);
}

} else {
output.setSuccess(false);
output.setReason(String.format("Received HTTP Status Code: %s", api.getLastStatusCode()));
}
}
output.setLastModifiedDate(api.getLastUpdated());

jsonOut.writeEndArray();
jsonOut.writeObjectField("results", output);
jsonOut.writeEndObject();
Expand Down

0 comments on commit b4a29d4

Please sign in to comment.