mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Merge pull request #11291 from xianzhe-databricks:fix-uds-auth
PiperOrigin-RevId: 712981221
This commit is contained in:
@@ -39,6 +39,15 @@ func CredentialsFromContext(ctx context.Context) *Credentials {
|
||||
return NewAnonymousCredentials()
|
||||
}
|
||||
|
||||
// CredentialsOrNilFromContext returns a copy of the Credentials used by ctx,
|
||||
// or nil if ctx does not have Credentials.
|
||||
func CredentialsOrNilFromContext(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