-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add remote call authn #1
base: master
Are you sure you want to change the base?
Conversation
return remoteCall, nil | ||
} | ||
|
||
func getUserName(response *remotecall.UserKeyAuthResponse) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe call it generateUpstreamUserName
or sth like that to avoid confusion between incoming and outgoing user name
plugin/remotecall/main.go
Outdated
return &libplugin.SshPiperPluginConfig{ | ||
|
||
NextAuthMethodsCallback: func(_ libplugin.ConnMetadata) ([]string, error) { | ||
return []string{"publickey"}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it map to PublicKeyCallback
?
}, | ||
|
||
PublicKeyCallback: func(conn libplugin.ConnMetadata, key []byte) (*libplugin.Upstream, error) { | ||
clusterName, err := caller.GetClusterName(conn.User()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this .User()
method return the username passed in ssh connection ?
|
||
k := caller.MapKey() | ||
|
||
inClusterSvcUrl, err := caller.GetUpstreamSvcURL(clusterName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this point to the actual service url where the request will go ?
remoteCall, err := remotecall.InitRemoteCall( | ||
c.String(userClusterEndpoint), | ||
c.Generic(remoteEndpoints).(*remotecall.StringMapFlag).Value, | ||
c.Path(mappingKeyPath), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this file contain ? Is it part of different PR ?
Can we add that in this same PR so it can be tested independently.
This pull request has been automatically closed due to 30 days of inactivity. If you believe this was done in error, please feel free to reopen the PR or reach out to the BT team for further assistance. Thank you for your contributions! |
SSH piper has a plugin based env where main code provides handle to plugin binary via grpc and asks for things it need for authn on upstream to create the pipe.
As part of response of plugin it expects callback for each of the auth method which plugin supports and host-port-username-key to use while talking to upstream.
So we are implementing the interface
remotecall
over helperpluginbase
which takes as cli input different host names to get auth data and then return it to grpc main to handle connection