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

Support multibyte username on xml response. #628

Closed
ksauzz opened this issue Jul 29, 2013 · 13 comments
Closed

Support multibyte username on xml response. #628

ksauzz opened this issue Jul 29, 2013 · 13 comments
Assignees
Milestone

Comments

@ksauzz
Copy link
Contributor

ksauzz commented Jul 29, 2013

List users and show user API doesn't support multibyte on xml response. So name is garbled.

create user

[vagrant@localhost ~]$ nkf --utf8 user.json
{"name": "ほげほげ", "email":"test@example.com"}
[vagrant@localhost ~]$ curl -i http://localhost:8080/riak-cs/user -H "Content-Type: application/json" -d @user.json
HTTP/1.1 201 Created
Vary: Accept
Server: Riak CS
Location: http://localhost:8080/riak-cs/user
Date: Mon, 29 Jul 2013 05:58:22 GMT
Content-Type: application/json
Content-Length: 263

{"email":"test@example.com","display_name":"test","name":"\u307b\u3052\u307b\u3052","key_id":"X9Z01FRHMO1YJWZT-1B7","key_secret":"ueFnnV1pwc1VNg_vHvnLKC6Ah1nw888rO90PnQ==","id":"6d0e53854eed0b7f3df6605aac08723855a89091bc84848f9346b0cfd39cd08b","status":"enabled"}[vagrant@localhost ~]$

list user

XML response

[vagrant@localhost ~]$ ./s3curl.pl --id admin -- -x localhost:8080 http://riak-cs.s3.amazonaws.com/users

--OP3SKSJCRRKG6UJN3NZ50NKLFIJ47Y3
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?><Users><User><Email>test@example.com</Email><DisplayName>test</DisplayName><Name>����</Name><KeyId>X9Z01FRHMO1YJWZT-1B7</KeyId><KeySecret>ueFnnV1pwc1VNg_vHvnLKC6Ah1nw888rO90PnQ==</KeySecret><Id>6d0e53854eed0b7f3df6605aac08723855a89091bc84848f9346b0cfd39cd08b</Id><Status>enabled</Status></User></Users>
--OP3SKSJCRRKG6UJN3NZ50NKLFIJ47Y3
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8"?><Users><User><Email>user@example.com</Email><DisplayName>user</DisplayName><Name>user</Name><KeyId>O0YC0RKWM69HIG0NDVG1</KeyId><KeySecret>QdHYZVitFaGqfh-LSriGcMU_NDYNAh9z2MHhXg==</KeySecret><Id>02e40edb2ad4049bb75c2d4963f720a640f9e1f716c721f326759473afbda80d</Id><Status>enabled</Status></User></Users>
--OP3SKSJCRRKG6UJN3NZ50NKLFIJ47Y3

JSON response

[vagrant@localhost ~]$ ./s3curl.pl --id admin -- -x localhost:8080 -H "Accept:application/json" http://riak-cs.s3.amazonaws.com/users

--LHDGOZNBC03AS9SJORMHHDS4WMEPTT9
Content-Type: application/json

[{"email":"test@example.com","display_name":"test","name":"\u307b\u3052\u307b\u3052","key_id":"X9Z01FRHMO1YJWZT-1B7","key_secret":"ueFnnV1pwc1VNg_vHvnLKC6Ah1nw888rO90PnQ==","id":"6d0e53854eed0b7f3df6605aac08723855a89091bc84848f9346b0cfd39cd08b","status":"enabled"}]
--LHDGOZNBC03AS9SJORMHHDS4WMEPTT9
Content-Type: application/json

[{"email":"user@example.com","display_name":"user","name":"user","key_id":"O0YC0RKWM69HIG0NDVG1","key_secret":"QdHYZVitFaGqfh-LSriGcMU_NDYNAh9z2MHhXg==","id":"02e40edb2ad4049bb75c2d4963f720a640f9e1f716c721f326759473afbda80d","status":"enabled"}]

show user

XML response.

[vagrant@localhost ~]$ ./s3curl.pl --id admin -- -x localhost:8080 http://riak-cs.s3.amazonaws.com/user/X9Z01FRHMO1YJWZT-1B7/
<?xml version="1.0" encoding="UTF-8"?><User><Email>test@example.com</Email><DisplayName>test</DisplayName><Name>����</Name><KeyId>X9Z01FRHMO1YJWZT-1B7</KeyId><KeySecret>ueFnnV1pwc1VNg_vHvnLKC6Ah1nw888rO90PnQ==</KeySecret><Id>6d0e53854eed0b7f3df6605aac08723855a89091bc84848f9346b0cfd39cd08b</Id><Status>enabled</Status></User>

show user

JSON response

[vagrant@localhost ~]$ ./s3curl.pl --id admin -- -x localhost:8080 -H "Accept:application/json" http://riak-cs.s3.amazonaws.com/user/X9Z01FRHMO1YJWZT-1B7/
{"email":"test@example.com","display_name":"test","name":"\u307b\u3052\u307b\u3052","key_id":"X9Z01FRHMO1YJWZT-1B7","key_secret":"ueFnnV1pwc1VNg_vHvnLKC6Ah1nw888rO90PnQ==","id":"6d0e53854eed0b7f3df6605aac08723855a89091bc84848f9346b0cfd39cd08b","status":"enabled"}[vagrant@localhost ~]$
@reiddraper
Copy link
Contributor

Is this a 1.4 blocker?

@ksauzz
Copy link
Contributor Author

ksauzz commented Aug 5, 2013

No. Thank you for the attention.

@shino
Copy link
Contributor

shino commented Aug 7, 2013

Good reference for Latin-1 and Unicode in Erlang.
Codepoints, encodings, string literals, binaries and more.
http://www.erlang-factory.com/conference/ErlangUserConference2013/speakers/PatrikNyblom

@ghost ghost assigned ponta1024 Sep 9, 2013
@reiddraper
Copy link
Contributor

Thoughts on priorities of this for 1.5? Scope of work?

@kuenishi
Copy link
Contributor

It's not a bit feature so I think we can do it.

@kuenishi
Copy link
Contributor

I think it's too much to support unicode. But the bad situation is, users can create a user named with unicode. So adding a validation that accepts only ascii printable characters would be enough. Any thoughts? CC: @shino

@kuenishi
Copy link
Contributor

kuenishi commented Feb 3, 2014

As there are no customer request for now, I'll suggest above change to Riak CS and decision not to support unicode chars as user names.

@shino
Copy link
Contributor

shino commented Feb 3, 2014

I'll suggest above change to Riak CS and decision not to support unicode chars as user names.

+1

@kuenishi
Copy link
Contributor

kuenishi commented Feb 4, 2014

Will be solved after #787 fixed.

@shino shino modified the milestones: 1.4.5, 1.5.0 Feb 5, 2014
shino added a commit that referenced this issue Feb 5, 2014
This is the case of #628.
Fix has already been made by the commit d742add
shino added a commit that referenced this issue Feb 5, 2014
This is the case of #628.
Fix has already been made by the commit d742add
@shino
Copy link
Contributor

shino commented Feb 5, 2014

Addressed by #794

@reiddraper
Copy link
Contributor

Previous comments suggested we would not_ support unicode usernames, but #794 seems to add support them. Is that correct? Are there any issues with names that might have been saved with previous versions of Riak CS?

@kuenishi
Copy link
Contributor

kuenishi commented Feb 6, 2014

I assume that any previous version of Riak CS cannot print multibyte usernames correctly and thus no one is using unicode characters.
My aim was to reduce complexity and further fix, but Shino's fix on #794 has unexpected side effect, which is good. We still won't recommend unicode names, but it works so far.

shino added a commit that referenced this issue Feb 6, 2014
This is the case of #628.
Fix has already been made by the commit d742add
shino added a commit that referenced this issue Feb 6, 2014
This is the case of #628.
Fix has already been made by the commit b244470
shino added a commit that referenced this issue Feb 12, 2014
This is the case of #628.
Fix has already been made by the commit b244470
shino added a commit that referenced this issue Feb 12, 2014
This is the case of #628.
Fix has already been made by the commit d215335
shino added a commit that referenced this issue Feb 14, 2014
@shino
Copy link
Contributor

shino commented Feb 14, 2014

Fixed by #807.
Non-ASCII UTF-8 characters can be used and printed properly.

@shino shino closed this as completed Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants