Conversation
…lities get and create, create metrics labels and metrics data commands from nionic data
| ), | ||
| ) | ||
|
|
||
| org_id_slugs = { |
There was a problem hiding this comment.
Is it possible to embed the org slug in the JWT token that gives us the org_id? Having this mapping hardcoded is publicly listing our customers which can run afoul of service agreements.
There was a problem hiding this comment.
I'm not sure, I think a better long-term plan would be to have some kind of service-discovery in place. As for this, I was just going with what we did in the js sdk already
There was a problem hiding this comment.
In reality, we should be moving away from orgId in my mind. It will be a stale concept once all services are single tenant. Instead, you would access everything my tenant slug. This is fine for now, we will just have to update later one. Could we potentially allow passing either orgId or slug and just take the slug as-is?
luther-at-ndustrial
left a comment
There was a problem hiding this comment.
Awesome work! I love the metric cli additions!
| ApiField("created_at", data_type=Parsers.datetime), | ||
| ApiField("weather_location_id"), | ||
| ApiField("slug"), | ||
| from sgqlc.types import Arg, Enum, Field, Input, Type, list_of, non_null |
There was a problem hiding this comment.
was this generated or manually written?
There was a problem hiding this comment.
Taken from the codegen output but I was having some trouble getting it working here, so manually written with a template
| ), | ||
| ) | ||
|
|
||
| org_id_slugs = { |
There was a problem hiding this comment.
In reality, we should be moving away from orgId in my mind. It will be a stale concept once all services are single tenant. Instead, you would access everything my tenant slug. This is fine for now, we will just have to update later one. Could we potentially allow passing either orgId or slug and just take the slug as-is?
|
@mgagliardo91 @luther-at-ndustrial I made an option to pass in either a slug or an organization id which may be helpful, but only really for library usage for internal services/cli usage for users with more than one org_id in their token. Not sure if this is preferred, I can revert the commit if it feels messy or unhelpful |
| super().__init__(env, auth, **kwargs) | ||
| self.endpoint = RequestsEndpoint(f"{self.base_url}/graphql", session=self.session) | ||
|
|
||
| def query(self, query: str, variables: Optional[Any] = None) -> Dict: |
793c33b to
18d945a
Compare
Why?
What changed?