Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

feat: device cert validation #57

Merged
merged 1 commit into from
Oct 29, 2020

Conversation

Moopli
Copy link
Contributor

@Moopli Moopli commented Oct 27, 2020

Signed-off-by: Filip Burlacu filip.burlacu@securekey.com

@Moopli Moopli self-assigned this Oct 27, 2020
@cla-bot cla-bot bot added the cla-signed label Oct 27, 2020
@Moopli
Copy link
Contributor Author

Moopli commented Oct 27, 2020

Still needs unit tests and some work on defining the rest api

@llorllale
Copy link
Contributor

@Moopli this endpoint must also register and associate the device to the user's profile, therefore needs as input the user's sub. We should also accept the AAGUID that identifies the device's model.

@llorllale
Copy link
Contributor

Also, endpoint path should be renamed to just /device

@Moopli Moopli force-pushed the verify-device-cert branch 2 times, most recently from a51c561 to b9d1230 Compare October 29, 2020 14:20
@Moopli Moopli marked this pull request as ready for review October 29, 2020 14:21
@Moopli Moopli changed the title wip: device cert validation feat: device cert validation Oct 29, 2020
@Moopli Moopli requested a review from llorllale October 29, 2020 14:27
@llorllale llorllale mentioned this pull request Oct 29, 2020
@@ -16,6 +16,7 @@ import (
// Profile is the user's bootstrap profile.
type Profile struct {
ID string
AAGUID string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followup: #58

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@troyronda
Copy link
Contributor

Codecov should be fixed.

@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #57 into master will not change coverage.
The diff coverage is 89.47%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   87.69%   87.69%           
=======================================
  Files           8        8           
  Lines         455      520   +65     
=======================================
+ Hits          399      456   +57     
- Misses         34       39    +5     
- Partials       22       25    +3     
Impacted Files Coverage Δ
pkg/bootstrap/user/userprofile.go 84.61% <ø> (ø)
cmd/auth-rest/startcmd/start.go 89.36% <86.66%> (-0.83%) ⬇️
pkg/restapi/operation/operations.go 88.06% <91.30%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6accc3...9f8daf4. Read the comment docs.

Registers a user device AAGUID to the user's profile,
after validating that the device's certificate is valid
according to the given intermediate certificates and
the server's trusted set of device root CAs.

POST to /device with a JSON body:
{
  "x5c": [
    "---USER DEVICE CERT, PEM ENCODED---",
    "---INTERMEDIATE CERT 1, PEM ENCODED---",
    "---INTERMEDIATE CERT 2, PEM ENCODED---",
          ...
  ],
  "sub": "user sub",
  "aaguid": "user device AAGUID" [optional]
}

Closes trustbloc#56

Signed-off-by: Filip Burlacu <filip.burlacu@securekey.com>
@llorllale llorllale merged commit 8b3f8aa into trustbloc:master Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants