mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
Renames the product across user-facing text -- 1475 lines, i18n and the defaultMessage strings that must match it -- while leaving the names that are code rather than prose: upstream copyright, Go import paths, the @mattermost npm scope, i18n keys, Go template fields, and legacy theme identifiers like AuthorType.Mattermost and the 'Mattermost' key that maps an old theme to a new one. The rule is a word boundary on identifier characters; MattermostEntry is a symbol, "Mattermost" in a sentence is the product. The theme goes monochrome. Hanzo and Hanzo Dark are the two built-ins and Hanzo is the default, with the CSS custom properties that carry brand colour outside the theme object -- sidebar, buttons, links, titles -- moved to black. Status colours stay: online, away, do-not-disturb and error encode state, not brand, and flattening them to grey would cost meaning to buy consistency. The sign-in header drops the TEAM EDITION badge. It advertised which licence tier you were on, and there are no tiers here. Booting without a licence is now logged at debug rather than warned about, because it is this server's normal condition rather than a fault. Co-authored-by: Hanzo Dev <[email protected]>
62 lines
1.8 KiB
Go
62 lines
1.8 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package filestore
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
|
)
|
|
|
|
// customTransport is used to point the request to a different server.
|
|
// This is helpful in situations where a different service is handling AWS S3 requests
|
|
// from multiple Hanzo Team applications, and the Hanzo Team service itself does not
|
|
// have any S3 credentials.
|
|
type customTransport struct {
|
|
host string
|
|
scheme string
|
|
client http.Client
|
|
}
|
|
|
|
// RoundTrip implements the http.Roundtripper interface.
|
|
func (t *customTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
// Roundtrippers should not modify the original request.
|
|
newReq := req.Clone(context.Background())
|
|
*newReq.URL = *req.URL
|
|
req.URL.Scheme = t.scheme
|
|
req.URL.Host = t.host
|
|
return t.client.Do(req)
|
|
}
|
|
|
|
// customProvider is a dummy credentials provider for the minio client to work
|
|
// without actually providing credentials. This is needed with a custom transport
|
|
// in cases where the minio client does not actually have credentials with itself,
|
|
// rather needs responses from another entity.
|
|
//
|
|
// It satisfies the credentials.Provider interface.
|
|
type customProvider struct {
|
|
isSignV2 bool
|
|
}
|
|
|
|
// RetrieveWithCredContext simply calls Retrieve, because we don't need to use
|
|
// the param.
|
|
func (cp customProvider) RetrieveWithCredContext(_ *credentials.CredContext) (credentials.Value, error) {
|
|
return cp.Retrieve()
|
|
}
|
|
|
|
// Retrieve just returns empty credentials.
|
|
func (cp customProvider) Retrieve() (credentials.Value, error) {
|
|
sign := credentials.SignatureV4
|
|
if cp.isSignV2 {
|
|
sign = credentials.SignatureV2
|
|
}
|
|
return credentials.Value{
|
|
SignerType: sign,
|
|
}, nil
|
|
}
|
|
|
|
// IsExpired always returns false.
|
|
func (cp customProvider) IsExpired() bool { return false }
|