-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: add a new basic type identity #563
base: master
Are you sure you want to change the base?
Conversation
Let's please add a few more details about the feature to the PR description, and link to the spec (internal, I know). |
Just for the record, I'm pasting my little bit of research into the available sha-crypt libraries I could find. I think GehirnInc/crypt is the right choice.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Some minor stuff, but a couple of things worth further discussion, particularly how IdentityFromInputs
will need to change.
In the latest commit, I have fixed most comments except for the access level part and multiple identity type part. See above comment for more information. |
@IronCore864 Can you please merge from master now that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Looking forward to getting this in Pebble.
Some manual tests: 1 Two Types of Identityidentities:
bob:
access: metrics
basic:
password: $6$F9cFSVEKyO4gB1Wh$8S1BSKsNkF.jBAixGc4W7l80OpfCNk65LZBDHBng3NAmbcHuMj4RIm7992rrJ8YA.SJ0hvm.vGk2z483am4Ym1
local:
user-id: 1001 $ ./pebble add-identities --from ./identity.yaml
Added 1 new identity.
$ ./pebble identities
Name Access Types
bob metrics basic,local 2 No Password for Basic Typeidentities:
nancy:
access: metrics
basic:
password:
3 Invalid Access Level for Basic Typeidentities:
bob:
access: admin
basic:
password: $6$F9cFSVEKyO4gB1Wh$8S1BSKsNkF.jBAixGc4W7l80OpfCNk65LZBDHBng3NAmbcHuMj4RIm7992rrJ8YA.SJ0hvm.vGk2z483am4Ym1
|
A new "basic" type of identity and "metrics" type of access are added for the upcoming metrics feature.
To expose the upcoming metrics feature over HTTP, we need a certain level of authentication to protect the endpoint. We decided to use HTTP basic authentication for this purpose. A new type of "basic" identity needs to be implemented for this to work, and the access level would be
metrics
. The basic identity looks like this:Where the password is generated by
openssl passed -6
. The hashed password will be stored in the state, and when the user accesses the metrics endpoint, they need to set theAuthorization
header accordingly. Pebble daemon will sha512 hash the password and compare it to the identity stored in the state.For more details, see the spec here.