Allow for Multiple tokens#1
Conversation
Fix to allow either str or list for tokens and if str then make it a list. Also allow None and it will auto get them from API
Yet another fix to the tokens checks
oops
mathsman5133
left a comment
There was a problem hiding this comment.
Looks good - I will change the token name/description to something more interesting too lol. couple of little comments...
| else: | ||
| self._tokens = tokens | ||
|
|
||
| self._tokens = [token['key'] for token in current_tokens] |
There was a problem hiding this comment.
whats this do? should it be inside the if not tokens: block?
There was a problem hiding this comment.
Basically if tokens is none then we get them from the email/pass. Otherwise it uses the given tokens. I do think we should filter the tokens we get from the developer portal to only ones that are for the IP.
There was a problem hiding this comment.
Oh just read that again, yes it should be oops my bad
I believe this was a typo but that should fix it
This is only in draft as I'm running into a conundrum. Should we manage the token ammounts? Should we let the user decide how many tokens to use? Should we allow tokens to be named by the user so multiple Clients can use their own token naming schema?
|
Those changes should fix everything but the last one has a comment with some questions. Please refer to it as I want to make sure we're on the same page |
| clan = data.get('clan', {}) | ||
| if clan and ('tag' in clan.keys()): | ||
| clan = data.get('clan') | ||
| if clan and 'tag' in clan): |
There was a problem hiding this comment.
nice. thought it would raise some attribute error since default is none but works nicely.
Got an extra close bracket on line 502
There was a problem hiding this comment.
oops haha, will fix that and some more later, I think that tracking by token name may be the best, This would allow for multiple clients at once on different IPs
Suggest allowing multiple tokens as well as no tokens to be passed such that the client automatically looks up the tokens.
I attempted to make as many notes as possible, although I have not tested this code yet so be on the lookout for typos and such but this should be a good start toward this capability. Any questions lemme know!