mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 17:22:26 -05:00 
			
		
		
		
	[chore]: Bump github.com/SherClockHolmes/webpush-go from 1.3.0 to 1.4.0 (#3694)
Bumps [github.com/SherClockHolmes/webpush-go](https://github.com/SherClockHolmes/webpush-go) from 1.3.0 to 1.4.0. - [Release notes](https://github.com/SherClockHolmes/webpush-go/releases) - [Commits](https://github.com/SherClockHolmes/webpush-go/compare/v1.3.0...v1.4.0) --- updated-dependencies: - dependency-name: github.com/SherClockHolmes/webpush-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								3428bc9633
							
						
					
				
			
			
				commit
				
					
						a773768718
					
				
			
		
					 35 changed files with 2766 additions and 16 deletions
				
			
		
							
								
								
									
										21
									
								
								vendor/github.com/SherClockHolmes/webpush-go/vapid.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								vendor/github.com/SherClockHolmes/webpush-go/vapid.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -5,12 +5,12 @@ import ( | |||
| 	"crypto/elliptic" | ||||
| 	"crypto/rand" | ||||
| 	"encoding/base64" | ||||
| 	"fmt" | ||||
| 	"math/big" | ||||
| 	"net/url" | ||||
| 	"strings" | ||||
| 	"time" | ||||
| 
 | ||||
| 	"github.com/golang-jwt/jwt" | ||||
| 	"github.com/golang-jwt/jwt/v5" | ||||
| ) | ||||
| 
 | ||||
| // GenerateVAPIDKeys will create a private and public VAPID key pair | ||||
|  | @ -72,10 +72,15 @@ func getVAPIDAuthorizationHeader( | |||
| 		return "", err | ||||
| 	} | ||||
| 
 | ||||
| 	// Unless subscriber is an HTTPS URL, assume an e-mail address | ||||
| 	if !strings.HasPrefix(subscriber, "https:") { | ||||
| 		subscriber = "mailto:" + subscriber | ||||
| 	} | ||||
| 
 | ||||
| 	token := jwt.NewWithClaims(jwt.SigningMethodES256, jwt.MapClaims{ | ||||
| 		"aud": fmt.Sprintf("%s://%s", subURL.Scheme, subURL.Host), | ||||
| 		"exp": expiration.Unix(), | ||||
| 		"sub": fmt.Sprintf("mailto:%s", subscriber), | ||||
| 		"aud": subURL.Scheme + "://" + subURL.Host, | ||||
| 		"exp": time.Now().Add(time.Hour * 12).Unix(), | ||||
| 		"sub": subscriber, | ||||
| 	}) | ||||
| 
 | ||||
| 	// Decode the VAPID private key | ||||
|  | @ -98,11 +103,7 @@ func getVAPIDAuthorizationHeader( | |||
| 		return "", err | ||||
| 	} | ||||
| 
 | ||||
| 	return fmt.Sprintf( | ||||
| 		"vapid t=%s, k=%s", | ||||
| 		jwtString, | ||||
| 		base64.RawURLEncoding.EncodeToString(pubKey), | ||||
| 	), nil | ||||
| 	return "vapid t=" + jwtString + ", k=" + base64.RawURLEncoding.EncodeToString(pubKey), nil | ||||
| } | ||||
| 
 | ||||
| // Need to decode the vapid private key in multiple base64 formats | ||||
|  |  | |||
							
								
								
									
										1
									
								
								vendor/github.com/SherClockHolmes/webpush-go/webpush.go
									
										
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/SherClockHolmes/webpush-go/webpush.go
									
										
									
										generated
									
									
										vendored
									
									
								
							|  | @ -201,7 +201,6 @@ func SendNotificationWithContext(ctx context.Context, message []byte, s *Subscri | |||
| 	} | ||||
| 
 | ||||
| 	req.Header.Set("Content-Encoding", "aes128gcm") | ||||
| 	req.Header.Set("Content-Length", strconv.Itoa(len(ciphertext))) | ||||
| 	req.Header.Set("Content-Type", "application/octet-stream") | ||||
| 	req.Header.Set("TTL", strconv.Itoa(options.TTL)) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue