Gusted and zeripath
b76970f2e4
Fix key signature error page ( #22229 )
...
- When the GPG key contains an error, such as an invalid signature or an
email address that does not match the user.A page will be shown that
says you must provide a signature for the token.
- This page had two errors: one had the wrong translation key and the
other tried to use an undefined variable
[`.PaddedKeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/models/asymkey/gpg_key.go#L65-L72 ),
which is a function implemented on the `GPGKey` struct, given that we
don't have that, we use
[`KeyID`](https://github.com/go-gitea/gitea/blob/e81ccc406bf723a5a58d685e7782f281736affd4/routers/web/user/setting/keys.go#L102 )
which is [the fingerprint of the
publickey](https://pkg.go.dev/golang.org/x/crypto/openpgp/packet#PublicKey.KeyIdString )
and is a valid way for opengpg to refer to a key.
Before:

After:

Co-authored-by: zeripath <art27@cantab.net >
2022-12-30 12:53:05 +08:00
Gusted and Lunny Xiao
b48cf03717
Remove deadcode ( #22245 )
...
- Remove code that isn't being used.
Found this is my stash from a few weeks ago, not sure how I found this
in the first place.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-27 09:15:35 +08:00
Gusted and KN4CK3R
90572c5a22
Specify ID in TestAPITeam ( #22192 )
...
- There have been [CI
failures](https://codeberg.org/forgejo/forgejo/issues/111 ) in this
specific test function. The code on itself looks good, the CI failures
are likely caused by not specifying any field in `TeamUser`, which might
have caused to unittest to return another `TeamUser` than the code
expects.
Co-authored-by: KN4CK3R <admin@oldschoolhack.me >
2022-12-21 09:22:23 +08:00
Gusted
40ba750c4b
Check for zero time instant in TimeStamp.IsZero() ( #22171 )
...
- Currently, the 'IsZero' function for 'TimeStamp' just checks if the
unix time is zero, which is not the behavior of 'Time.IsZero()', but
Gitea is using this method in accordance with the behavior of
'Time.IsZero()'.
- Adds a new condition to check for the zero time instant.
- Fixes a bug where non-expiring GPG keys where shown as they expired on
Jan 01, 0001.
- Related https://codeberg.org/Codeberg/Community/issues/791
Before:

After:

2022-12-20 10:04:55 +08:00