For the access tokens, do they work with the edit ...
# ingestion
b
For the access tokens, do they work with the edit policies? Ie if person A does not have edit rights to a dataset and passes in a MCE/MCP about that dataset to :9002/api/gms with his access token, will he be rejected? also, if i do not allow users to generate their own token, can I still query for user's tokens in the backend (via custom UI code) and use it to ingest metadata on their behalf?
answering my own question: can I still query for user's tokens in the backend if they are not allowed to generate their own token => Nope, can't query for their token.
However, MCEs seemed to be accepted regardless of policies imposed on a person?? Also, policies dont cover every possible aspect such as browsepaths.
h
cc: @big-carpet-38439
b
@better-orange-49102 For now, privileges are limited to logical. We do not have access privileges for each specific aspect. Additionally, fine-grained access policies are only enforced when you are calling the GraphQL API -- Restli APIs used for ingestion are not managed with policies (though the framework can be extended to support it) What is the use case you're hoping to achieve in querying for another user's token? As detailed in this deep dive ( and the original metadata service auth design doc ), there is currently no authentication on the kafka ingestion path
b
Thanks for the detailed reply @big-carpet-38439! Actually there's no reason why I'll need to query for other people's token - that was a poorly phrased question. In my code I'll query for and get the page users' code to pass to a third party API which uses that to create a rest emitter with the user token. Is there a way to verify the token against the user, though? I want to avoid a case where the user copied his token but uses another identity. If there is a way to check if the token belongs to the user that would be immense for me. Ie, an endpoint that I can query with a token string to check the users identity and expiry date.
i suppose i could decode the jwt to verify the user identity? is the signing key to be specified in ./datahub-frontend/conf/application.conf?
b
Got it. So one way is to hit the "me" endpoint in GraphQL, which will return the URN for the currently authenticated user
Would that work?
It won't provide token expiry tho. That can be found inside the JWT itself
The best way would be to decode the JWT, check the actor claim and exp claim, and verify the signature. Currently we sign using HS256 so you'd need to have the signing key available wherever you want to do the verification 😕
Now ideally we'd support RS256 in our TokenService component which would allow to sign with a private key and verify with a public key
Maybe that'd be something you'd be interested in? It would be fairly straightforward
b
i think i'll just decode the jwt and verify that the token is who the person claims to be in my 3th party API (since i deployed it) in the meantime, and i'll slowly work my way to write operations as opposed to read in graphql. 🙂
just to confirm, the secret to verify the jwt signature is defined at `systemClientSecret`` inside `/datahub-frontend/conf/application.conf``?
oh nvm, the token signing key is at
metadata-service/factories/src/main/resources/application.yml
b
correct!
ideally you'd set your own