mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add a new RPC ConnectWithCreds to allow gofer to connect to a unix domain socket with application's credentials
This commit is contained in:
@@ -39,6 +39,14 @@ func CredentialsFromContext(ctx context.Context) *Credentials {
|
||||
return NewAnonymousCredentials()
|
||||
}
|
||||
|
||||
// CredentialsFromContextOrNil returns a copy of the Credentials used by ctx, or nil if ctx does not have Credentials.
|
||||
func CredentialsFromContextOrNil(ctx context.Context) *Credentials {
|
||||
if v := ctx.Value(CtxCredentials); v != nil {
|
||||
return v.(*Credentials)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ThreadGroupIDFromContext returns the current thread group ID when ctx
|
||||
// represents a task context.
|
||||
func ThreadGroupIDFromContext(ctx context.Context) (tgid int32, ok bool) {
|
||||
|
||||
Reference in New Issue
Block a user