nephila / giturlparse

Parse & rewrite git urls (supports GitHub, Bitbucket, Assembla ...)
https://pypi.python.org/pypi/giturlparse
Apache License 2.0
31 stars 21 forks source link

github urls with access token are not supported #21

Closed godfryd closed 12 months ago

godfryd commented 4 years ago

Such urls has this form: https://\<access-token>@github.com/.... For example: https://fiuahjrehfakhdhauwe@github.com/nephila/giturlparse

yakky commented 4 years ago

@godfryd thanks for reporting I need to go back to work on #19 where we should be able to easily add this

protoroto commented 1 year ago

@godfryd Could you try on latest version? I'm able to parse that url correctly now

godfryd commented 1 year ago

Hello,

I tried giturparse 0.11.1 on the URL: https://fiuahjrehfakhdhauwe@github.com/nephila/giturlparse

I run:

p=giturlparse.parse('https://fiuahjrehfakhdhauwe@github.com/nephila/giturlparse')
print(p.data)

Parsed data does not seem well:

{'port': '',
 'path_raw': '',
 'groups_path': '',
 'owner': 'nephila',
 '_user': 'git',
 'protocols': ['https'],
 'protocol': 'https',
 'domain': 'fiuahjrehfakhdhauwe@github.com',
 'pathname': '/nephila/giturlparse',
 'repo': 'giturlparse',
 'path': '',
 'branch': '',
 'url': 'https://fiuahjrehfakhdhauwe@github.com/nephila/giturlparse',
 'platform': 'gitlab'}

I would expect that platform is github not gitlab, domain seems to be incorrect, access token could be stored in user field.

protoroto commented 1 year ago

@godfryd You're right: I guess access tokens are not supported yet. I'll look into it

protoroto commented 1 year ago

@godfryd I'm digging into this: it looks like urls with access token like the one you mentioned https://<access_token>@github.com/nephila/giturlparse are not supported by github/gitlab . I'm seeing that urls like https://oauth2:<access_token>@github.com/nephila/giturlparse are instead valid and supported (both for gitlab and github), so I'll work on this feature.

godfryd commented 1 year ago

ok, thanks :)

Michał Nowikowski

On Thu, Aug 31, 2023 at 11:48 AM Leonardo Cavallucci < @.***> wrote:

@godfryd https://github.com/godfryd I'm digging into this: it looks like urls with access token like the one you mentioned https:// @.***/nephila/giturlparse are not supported by github/gitlab . I'm seeing that urls like https://oauth2:@ github.com/nephila/giturlparse are instead valid and supported (both for gitlab and github), so I'll work on this feature.

— Reply to this email directly, view it on GitHub https://github.com/nephila/giturlparse/issues/21#issuecomment-1700719958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABLDNZIJ2MO3JD7YI2YCMTXYBMXTANCNFSM4KAIPR7Q . You are receiving this because you were mentioned.Message ID: @.***>

protoroto commented 11 months ago

@godfryd Hey! We've just release 0.12.0 that should support those urls.