Skip to content

Commit

Permalink
Merge branch 'renovate/all-minor' of https://github.com/CDCgov/truste…
Browse files Browse the repository at this point in the history
…d-intermediary into renovate/all-minor
  • Loading branch information
halprin committed Oct 10, 2023
2 parents 643a9d7 + 791afbe commit 82f4ad2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
25 changes: 18 additions & 7 deletions ig/input/fsh/nbs-spm-segment.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ Logical: SPMSegment
Id: segment-spm-logical-model
Title: "SPM Segment"
Description: "The SPM Segment"

* setSPMId 1..1 string "SPM-1 Set ID - SPM"
* assignedIdentifier 1..1 string "SPM-2.1 Placer Assigned Identifier"
* entityIdentifier 1..1 string "SPM-2.1.1 Entity Identifier"
* specimenType 1..1 string "SPM-4 Specimen Type"
* identifier 1..1 string "SPM-4.1 Identifier"
* codingSystem 1..1 string "SPM-4.3 Name of Coding System"
* specimenCollectionDateTime 1..1 string "SPM-17 Specimen Collection Date Time"
* rangeStartDateTime 1..1 string "SPM-17.1: Range Start Date Time"
* specimenTypeIdentifier 1..1 string "SPM-4.1 Identifier"
* specimenTypeCodingSystem 1..1 code "SPM-4.3 Name of Coding System"
* specimenRangeStartDateTime 1..1 dateTime "SPM-17.1 Specimen Range Start Date Time"
// other optional fields


// Provenance Section begins
Instance: segment-spm-logical-model-history-create
InstanceOf: Provenance
Expand All @@ -26,3 +23,17 @@ Usage: #definition
* activity = http://terminology.hl7.org/CodeSystem/v3-DataOperation#CREATE
* agent[+].type = http://terminology.hl7.org/CodeSystem/provenance-participant-type#author
* agent[=].who.display = "T. R. Johnson"


Instance: segment-spm-logical-model-history-update
InstanceOf: Provenance
Title: "Update of converted SPM segment fields and data type correction"
Usage: #definition
* target[+] = Reference(StructureDefinition/segment-spm-logical-model)
* recorded = "2023-10-09T17:41:23.0000Z"
* occurredDateTime = "2023-10-09"
* reason = http://terminology.hl7.org/CodeSystem/v3-ActReason#METAMGT
* reason.text = "Changed the sub-segments to the ones the system will initially support."
* activity = http://terminology.hl7.org/CodeSystem/v3-DataOperation#UPDATE
* agent[+].type = http://terminology.hl7.org/CodeSystem/provenance-participant-type#author
* agent[=].who.display = "T. Johnson"
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ public String generateToken(
public LocalDateTime getExpirationDate(String jwt) {

var tokenOnly = jwt.substring(0, jwt.lastIndexOf('.') + 1);
tokenOnly = "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0" + tokenOnly.substring(jwt.indexOf('.'));
// TODO: create an unsecured header and prepend that.

Claims claims;
try {
claims = Jwts.parserBuilder().build().parseClaimsJwt(tokenOnly).getBody();
claims = Jwts.parser().unsecured().build().parseUnsecuredClaims(tokenOnly).getPayload();
} catch (ClaimJwtException e) {
claims = e.getClaims();
}
Expand All @@ -101,7 +103,7 @@ public void validateToken(String jwt, String encodedKey)

try {
var key = readKey(encodedKey);
Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(jwt);
Jwts.parser().setSigningKey(key).build().parseClaimsJws(jwt);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note library

Invoking
JwtParser.parseClaimsJws
should be avoided because it has been deprecated.

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note library

Invoking
JwtParserBuilder.setSigningKey
should be avoided because it has been deprecated.

} catch (JwtException | IllegalArgumentException e) {
throw new InvalidTokenException(e);
Expand Down

0 comments on commit 82f4ad2

Please sign in to comment.