Comments (4)
Thanks for raising this issue @jgongil
Usernames are supposed to be case-insensitive in the platform so generally it shouldn't matter. The problem is in this project we are lowercasing it, but then comparing to the original case. The solution is to ensure comparisons are case-insensitive. Specifically here:
Line 62 in a51c133
If you've got time to PR a fix I'll be happy to merge it. Otherwise I'll ask someone to take a look soon.
from api_sdk.
Many thanks for your help @hamishmorgan
I got around it by changing the comparison in _test_auth(self, username, token) as below, but at the same time I had to force/ensure that the BWUser is created with username in lower case.
def _test_auth(self, username, token): ... elif user["username"].lower() == username: #JG[20180904]: JSON can contain username in capital letters
from api_sdk.
Why not lower-cased both sides?
elif user["username"].lower() == username.lower()
That way people can use whatever case they like, and it just ignores it during comparison.
from api_sdk.
Hi, yes we can, but that requires not only changing _test_auth
but also:
_read_auth
which is also doing if username in user_tokens
(mixed case vs lower case)
from api_sdk.
Related Issues (20)
- Allowing lists of startDates in "get_mentions" HOT 2
- BWProjects should take a BWUser instance HOT 2
- Add a rename() method HOT 1
- `BWRules.get()` returns a list with one item HOT 1
- patch_mentions allows users pass in multiple parent categories HOT 2
- pypi still at 1.1.2 HOT 1
- Port rule backfill to use new bulk-actions endpoint HOT 2
- Backfill_date not getting updated: upload_all
- Extract data from group HOT 2
- Does the parameter: Exclude Category can be used in the API? HOT 2
- Change token request from GET to POST
- Race condition when read token file HOT 3
- KeyError: 'id_str' when using upload_all_channel HOT 2
- Don't sleep before each requests
- Bug in chart calls which break down by specific tags
- Modify how tokens are passed in API calls
- from authenticate import authenticate HOT 6
- Duplicate resource name in BWResource.ids HOT 2
- filter zero value when retrieve dimension data HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api_sdk.