request: redirect from user email to user profile? #6291

Closed
opened 2025-11-02 06:51:11 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @Spongman on GitHub (Nov 10, 2020).

we have a CI system and we'd like to include links in the build emails that get sent out that include a link to the committer's gitea profile page. however, the CI system doesn't know about LDAP and/or gitea users, it just knows the user's email address (from the git commit) ...

can you please add a redirect URL that redirects from a gitea user's email address to their user profile?

eg. https://gitea.company.com/user/myemail@company.com?tab=... -> https://gitea.company.com/myuser?tab=...

Originally created by @Spongman on GitHub (Nov 10, 2020). we have a CI system and we'd like to include links in the build emails that get sent out that include a link to the committer's gitea profile page. however, the CI system doesn't know about LDAP and/or gitea users, it just knows the user's email address (from the git commit) ... can you please add a redirect URL that redirects from a gitea user's email address to their user profile? eg. `https://gitea.company.com/user/myemail@company.com?tab=...` -> `https://gitea.company.com/myuser?tab=...`
Author
Owner

@techknowlogick commented on GitHub (Nov 10, 2020):

I'm hesitant about this from a security standpoint, as it allows for email->user enumeration.

@techknowlogick commented on GitHub (Nov 10, 2020): I'm hesitant about this from a security standpoint, as it allows for email->user enumeration.
Author
Owner

@Spongman commented on GitHub (Nov 10, 2020):

that's not an issue for us, our installation is entirely internal.

@Spongman commented on GitHub (Nov 10, 2020): that's not an issue for us, our installation is entirely internal.
Author
Owner

@Spongman commented on GitHub (Nov 10, 2020):

or how about a redirect from a commit hash to the author's profile? i just need a way to get from a git commit to a profile.

eg. http://gitea.company.com/Org/repo/commit/<hash>/author

@Spongman commented on GitHub (Nov 10, 2020): or how about a redirect from a commit hash to the author's profile? i just need a way to get from a git commit to a profile. eg. `http://gitea.company.com/Org/repo/commit/<hash>/author`
Author
Owner

@mrsdizzie commented on GitHub (Nov 11, 2020):

Can use the API for this:

curl -X GET "https://try.gitea.io/api/v1/repos/mrsdizzie/testme/git/commits/9e1d206e4b" -H  "accept: application/json"

Response will have both author and committer information with a username you can use for creating a link

"author": {
    "id": 11691,
    "login": "mrsdizzie",
    "full_name": "",
    "email": "mrsdizzie@noreply.try.gitea.io",
    "avatar_url": "https://try.gitea.io/user/avatar/mrsdizzie/-1",
    "language": "",
    "is_admin": false,
    "last_login": "0001-01-01T00:00:00Z",
    "created": "2019-02-21T06:32:17Z",
    "username": "mrsdizzie"
  },
@mrsdizzie commented on GitHub (Nov 11, 2020): Can use the API for this: ```curl curl -X GET "https://try.gitea.io/api/v1/repos/mrsdizzie/testme/git/commits/9e1d206e4b" -H "accept: application/json" ``` Response will have both author and committer information with a username you can use for creating a link ``` "author": { "id": 11691, "login": "mrsdizzie", "full_name": "", "email": "mrsdizzie@noreply.try.gitea.io", "avatar_url": "https://try.gitea.io/user/avatar/mrsdizzie/-1", "language": "", "is_admin": false, "last_login": "0001-01-01T00:00:00Z", "created": "2019-02-21T06:32:17Z", "username": "mrsdizzie" }, ```
Author
Owner

@techknowlogick commented on GitHub (Nov 11, 2020):

closing per latest comment with API option provided.

@techknowlogick commented on GitHub (Nov 11, 2020): closing per latest comment with API option provided.
Author
Owner

@Spongman commented on GitHub (Nov 11, 2020):

the AP is a royal pain to use from a shell script, though. A redirect like i requested would be so much easier... oh well,.

@Spongman commented on GitHub (Nov 11, 2020): the AP is a royal pain to use from a shell script, though. A redirect like i requested would be so much easier... oh well,.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6291