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

Device access checks and metadata middleware #165

Open
j-mai opened this issue Dec 8, 2020 · 0 comments
Open

Device access checks and metadata middleware #165

j-mai opened this issue Dec 8, 2020 · 0 comments

Comments

@j-mai
Copy link
Contributor

j-mai commented Dec 8, 2020

Currently, when we are adding the device metadata, we require that the attributes from the token parsed by bascule implements the RawAttributes interface in order to copy all of the claims into the device metadata:

if tokenAttributes, ok := auth.Token.Attributes().(RawAttributes); ok {

If it doesn't implement the RawAttributes interface, we only copy the partner-id and trust claims: https://github.com/xmidt-org/talaria/blob/ee5fb72dd3f6a2d3b8a86a770e7354d683cf315f/middleware.go#L29-#L36

This is currently fine, since our device access check mainly only uses partner-id. However, this can be problematic if we decide to add checks to the deviceAccessChecks section of the config that are not partner-id or trust, and device access check will fail. A possible solution is to instead get all of the claims that are described by the deviceCredentialPath in all of the configured checks that are listed in the config:

# # deviceCredentialPath: partner-ids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant