Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing TO0 Scheme selection issue #685

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void generateHello() throws IOException {
generateDiHello();
logger.info("Generating Device Credential file");
} else {
setInstructions(HttpUtils.getInstructions(devCredential.getRvInfo(), true));
setInstructions(HttpUtils.getInstructions(devCredential.getRvInfo(), true, false));

storage.put(DeviceCredential.class, devCredential);
logger.info("credentials loaded, GUID is " + devCredential.getGuid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ private static boolean containsRvVariable(RendezvousDirective directive, Rendezv
* @return A List or URL strings.
* @throws IOException An error occurred.
*/
public static List<HttpInstruction> getInstructions(RendezvousInfo info, boolean isDevice)
throws IOException {
public static List<HttpInstruction> getInstructions(RendezvousInfo info, boolean isDevice,
boolean isOwner) throws IOException {

List<HttpInstruction> list = new ArrayList<>();
for (RendezvousDirective directive : info) {
Expand Down Expand Up @@ -206,8 +206,8 @@ public static List<HttpInstruction> getInstructions(RendezvousInfo info, boolean
port = devPort;
} else {
if (ownerPort.equals((devPort)) && devSchemes.contains(HTTP_SCHEME)
&& devSchemes.size() == 1
&& !ownerOnly) {
&& devSchemes.size() == 1
&& !ownerOnly && !isOwner) {
schemes = new ArrayList<>();
schemes.add(HTTP_SCHEME);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected void generateHello() throws IOException {
byte[] headerTag = getTo0d().getVoucher().getHeader();
OwnershipVoucherHeader header =
Mapper.INSTANCE.readValue(headerTag, OwnershipVoucherHeader.class);
setInstructions(HttpUtils.getInstructions(header.getRendezvousInfo(), false));
setInstructions(HttpUtils.getInstructions(header.getRendezvousInfo(), false, true));

//remove any instruction that are rvbypass
getInstructions().removeIf(n -> n.isRendezvousBypass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public UUID apply(String serialNo, OwnershipVoucher ownershipVoucher) throws IOE

OwnershipVoucherHeader header = VoucherUtils.getHeader(ownershipVoucher);
List<HttpInstruction> h1 = HttpUtils.getInstructions(header.getRendezvousInfo(),
false);
false, false);

List<HttpInstruction> h2 = HttpUtils.getInstructions(to2Entries);

Expand Down
Loading