forked from openshift-online/ocm-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* OCM-4962 | Feat | Add OAuth login using PKCE (openshift-online#590) * OCM-5759 | feat: Add Device Code Flow (openshift-online#591) * OCM-5281 | Feat | Add region validation from ocm-shards and list regions command (openshift-online#586) * Add region validation from ocm-shards and list regions command * Fixed mior debug changes * Marked rh region list flag hidden in cmd * Formatting change in example section in cmd file * OCM-4964: Secure store config * OCM-4964: Go mod tidy * OCM-4964: go mod tidy * OCM-4964: Secure store updates * OCM-4965: Use keyring for oauth flows * Temp: modify pub/release for testing * Add auth method password * Missed auth method test --------- Co-authored-by: tirthct <[email protected]>
- Loading branch information
1 parent
fab7ccf
commit 6ad3fab
Showing
10 changed files
with
298 additions
and
85 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
Copyright (c) 2024 Red Hat, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package delete | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/openshift-online/ocm-sdk-go/authentication/securestore" | ||
) | ||
|
||
var args struct { | ||
debug bool | ||
} | ||
|
||
var Cmd = &cobra.Command{ | ||
Use: "delete", | ||
Short: "Deletes the existing configuration from the OS keyring", | ||
Long: "Deletes the existing configuration from the OS keyring", | ||
Args: cobra.ExactArgs(0), | ||
RunE: run, | ||
Hidden: true, | ||
} | ||
|
||
func init() { | ||
flags := Cmd.Flags() | ||
flags.BoolVar( | ||
&args.debug, | ||
"debug", | ||
false, | ||
"Enable debug mode.", | ||
) | ||
} | ||
|
||
func run(cmd *cobra.Command, argv []string) error { | ||
err := securestore.RemoveConfigFromKeyring() | ||
if err != nil { | ||
return fmt.Errorf("can't delete config from keyring: %v", err) | ||
} | ||
return nil | ||
} |
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
Oops, something went wrong.