-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cocli: add remote service auth support
Add support for remote service authentication to the `corim submit` sub-command. Associated with it is support for loading configuration from a file (note: technically this was already present but was kind of broken and wasn't actually used for any configuration.) Signed-off-by: Sergei Trofimov <[email protected]>
- Loading branch information
Showing
8 changed files
with
1,164 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
package cmd | ||
|
||
import "github.com/veraison/apiclient/common" | ||
import ( | ||
"github.com/veraison/apiclient/auth" | ||
"github.com/veraison/apiclient/common" | ||
) | ||
|
||
type ISubmitter interface { | ||
Run([]byte, string) error | ||
SetClient(client *common.Client) error | ||
SetAuth(a auth.IAuthenticator) | ||
SetSubmitURI(uri string) error | ||
SetDeleteSession(session bool) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file contains example configuration for connecting to Veraison services. | ||
# This configuration is only necessary for the `cocli corim submit` sub-command, | ||
# as that is the only instance where remote service configuration is used. You | ||
# do not need this configuration for creating or manipulating corims/corim and | ||
# related objects locally. | ||
|
||
# Authentication method used by the remote service. | ||
auth: none # may also be "basic" or "oauth2" | ||
|
||
# Credentials for the remote service. | ||
username: example_user # used only if auth is "basic" or "oauth2" | ||
password: Passw0rd! # used only if auth is "basic" or "oauth2"; this can also | ||
# be specfied on the command line using --password, or by | ||
# setting COCLI_PASSWORD environment variable | ||
|
||
# OAuth2 cofiguration for the authorisation server associated with the remote | ||
# service. | ||
client_id: veraison-client # used only if auth is "oauth2" | ||
client_secret: YifmabB4cVSPPtFLAmHfq7wKaEHQn10Z # used only if auth is "oauth2" | ||
token_url: http://localhost:11111/realms/veraison/protocol/openid-connect/token # used only if auth is "oauth2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.