gnmi: standardise metadata username/password keys#183
Open
brianneville wants to merge 1 commit intoopenconfig:masterfrom
Open
gnmi: standardise metadata username/password keys#183brianneville wants to merge 1 commit intoopenconfig:masterfrom
brianneville wants to merge 1 commit intoopenconfig:masterfrom
Conversation
Currently, there is no standard for what keys should be used in the metadata to identify gNMI/gNOI username and password when doing authentication. By convention, the username and password are provided in the metadata with keys "username" and "password". (see examples below). It would be good to formalise this into the gNMI authentication reference spec here so that gNMI clients and servers can both be designed with this consensus. Some examples of current gNMI clients providing "username" and "password" as keys in metadata: 1. gnmi_cli client: https://github.com/openconfig/gnmi/blob/d5360e33fc3b22effeaaaf55f345c1f950765bed/client/gnmi/credentials.go#L35 2. goarista client: https://github.com/aristanetworks/goarista/blob/6112fea8c7e028c64ae52412952b0a2142b8c2e9/gnmi/client.go#L311 3. gnmic client: https://github.com/karimra/gnmic/blob/d1b198f67a99fe2f228d6119569310ebb1a50be3/target/target.go#L140 Note the other usages of metadata.AppendToOutgoingContext(ctx, "username", *t.Config.Username) and metadata.AppendToOutgoingContext(ctx, "password", *t.Config.Password) 4. pygnmi client https://github.com/akarneliuk/pygnmi/blob/3090d23ae32658026a244390a296f6ade01e9fb3/pygnmi/client.py#L54
hellt
reviewed
Mar 20, 2023
Comment on lines
+58
to
+67
| #### Metadata standards | ||
| <ul> | ||
| gRPC specifies <a href="https://grpc.io/docs/what-is-grpc/core-concepts/#metadata">metadata</a> as a list of arbitrary key/value pairs.<br> | ||
| The following metadata key/value pairs are therefore standardised across gNMI/gNOI for cases where metadata is involved in authentication: | ||
|
|
||
| | Key | Value | | ||
| |--------------|-----------------| | ||
| | `"username"` | client username | | ||
| | `"password"` | client password | | ||
| </ul> |
Contributor
There was a problem hiding this comment.
NIT: there seems to be no need in using HTML inside this markdown
ul and br can be omitted
Author
There was a problem hiding this comment.
They're just being used to indent the table and text to be aligned with the other lists above
for example:
heading
-
some text
| Key | Value |
|---|---|
"username" |
client username |
"password" |
client password |
vs
heading
some text
| Key | Value |
|---|---|
"username" |
client username |
"password" |
client password |
I think the first one looks a bit nicer so I'm inclined to keep it, but I can remove this if you want - let me know
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, there is no standard for what keys should be used in the metadata to identify gNMI/gNOI username and password when doing authentication.
By convention, the username and password are provided in the metadata with keys "username" and "password".
(see examples below).
It would be good to formalise this into the gNMI authentication reference spec here so that gNMI clients and servers can both be designed with this consensus.
Some examples of current gNMI clients providing "username" and "password" as keys in metadata:
gnmi_cli client: https://github.com/openconfig/gnmi/blob/d5360e33fc3b22effeaaaf55f345c1f950765bed/client/gnmi/credentials.go#L35
goarista client: https://github.com/aristanetworks/goarista/blob/6112fea8c7e028c64ae52412952b0a2142b8c2e9/gnmi/client.go#L311
gnmic client: https://github.com/karimra/gnmic/blob/d1b198f67a99fe2f228d6119569310ebb1a50be3/target/target.go#L140
Also note the other usages of
metadata.AppendToOutgoingContext(ctx, "username", *t.Config.Username)andmetadata.AppendToOutgoingContext(ctx, "password", *t.Config.Password)pygnmi client https://github.com/akarneliuk/pygnmi/blob/3090d23ae32658026a244390a296f6ade01e9fb3/pygnmi/client.py#L54