forked from Silverfish/proton-bridge
fix: missing and incorrect comments
This commit is contained in:
@ -275,6 +275,10 @@ func run(context *cli.Context) (contextError error) { // nolint[funlen]
|
|||||||
}
|
}
|
||||||
|
|
||||||
cm := pmapi.NewClientManager(cfg.GetAPIConfig())
|
cm := pmapi.NewClientManager(cfg.GetAPIConfig())
|
||||||
|
|
||||||
|
// Different build types have different roundtrippers (e.g. we want to enable
|
||||||
|
// TLS fingerprint checks in production builds). GetRoundTripper has a different
|
||||||
|
// implementation depending on whether build flag pmapi_prod is used or not.
|
||||||
cm.SetRoundTripper(cfg.GetRoundTripper(cm, eventListener))
|
cm.SetRoundTripper(cfg.GetRoundTripper(cm, eventListener))
|
||||||
|
|
||||||
bridgeInstance := bridge.New(cfg, pref, panicHandler, eventListener, Version, cm, credentialsStore)
|
bridgeInstance := bridge.New(cfg, pref, panicHandler, eventListener, Version, cm, credentialsStore)
|
||||||
|
|||||||
@ -125,6 +125,7 @@ func (s *Auth) UID() string {
|
|||||||
return s.uid
|
return s.uid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GenToken generates a string token containing the session UID and refresh token.
|
||||||
func (s *Auth) GenToken() string {
|
func (s *Auth) GenToken() string {
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
@ -106,6 +106,8 @@ func NewClientManager(config *ClientConfig) (cm *ClientManager) {
|
|||||||
return cm
|
return cm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetClientConstructor sets the method used to construct clients.
|
||||||
|
// By default this is `pmapi.newClient` but can be overridden with this method.
|
||||||
func (cm *ClientManager) SetClientConstructor(f func(userID string) Client) {
|
func (cm *ClientManager) SetClientConstructor(f func(userID string) Client) {
|
||||||
cm.newClient = f
|
cm.newClient = f
|
||||||
}
|
}
|
||||||
@ -130,7 +132,7 @@ func (cm *ClientManager) GetClient(userID string) Client {
|
|||||||
return cm.clients[userID]
|
return cm.clients[userID]
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAnonymousClient returns an anonymous client. It replaces any anonymous client that was already created.
|
// GetAnonymousClient returns an anonymous client.
|
||||||
func (cm *ClientManager) GetAnonymousClient() Client {
|
func (cm *ClientManager) GetAnonymousClient() Client {
|
||||||
return cm.GetClient(fmt.Sprintf("anonymous-%v", cm.idGen.next()))
|
return cm.GetClient(fmt.Sprintf("anonymous-%v", cm.idGen.next()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user