Comments (7)
It's a strange thing
from secman.
to fix this bug, let's create an if statement, like this
if !IsUserAthenticated {
return ":username"
}
from secman.
it's hard
from secman.
after many fixes and ideas, the final result is this
in tools/git_config/git_config.go
type ConfStruct struct {
HttpClient func() (*http.Client, error)
IO *iostreams.IOStreams
BaseRepo func() (ghrepo.Interface, error)
}
func NewCmdConfigRoot(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
SilenceErrors: true,
Run: func(cmd *cobra.Command, args []string) {},
}
cmd.SetOut(f.IOStreams.Out)
cmd.SetErr(f.IOStreams.ErrOut)
cmdutil.DisableAuthCheck(cmd)
return cmd
}
func GitConfig(f *cmdutil.Factory, msg1 string, msg2 string) string {
opts := ConfStruct{
HttpClient: f.HttpClient,
}
httpClient, herr := opts.HttpClient()
if herr != nil {
return herr.Error()
}
apiClient := api.NewClientFromHTTP(httpClient)
currentUser, _ := api.CurrentLoginName(apiClient, ghinstance.Default())
cmdFactory := factory.New("x")
configRootCmd := NewCmdConfigRoot(cmdFactory)
cfg, _ := cmdFactory.Config()
expandedArgs := []string{}
if len(os.Args) > 0 {
expandedArgs = os.Args[1:]
}
cmd, _, _ := configRootCmd.Traverse(expandedArgs)
if cmdutil.IsAuthCheckEnabled(cmd) && !cmdutil.CheckAuth(cfg) {
return msg1 + ":username" + msg2
} else {
return msg1 + currentUser + msg2
}
}
from secman.
All this is just for the sake of this
if !IsUserAthenticated {
return ":username"
}
from secman.
of course, and it's works
if the user was authenticated
open: Open Your Private Repo (abdfnx/.secman).
if the user is wasn't authenticated
open: Open Your Private Repo (:username/.secman).
from secman.
it's also for sync
command
if the user was authenticated
clone: Clone your .secman from your private repo at https://github.com/abdfnx/.secman .
pull: Pull The New Passwords from abdfnx/.secman .
push: Push The New Passwords in ~/.secman .
start: Start Sync your passwords.
if the user is wasn't authenticated
clone: Clone your .secman from your private repo at https://github.com/:username/.secman .
pull: Pull The New Passwords from :username/.secman .
push: Push The New Passwords in ~/.secman .
start: Start Sync your passwords.
from secman.
Related Issues (20)
- use `bcrypt` as master password hasher
- update secman website. HOT 1
- `Homedir` bug in windows HOT 2
- Can't Create new account HOT 4
- Secman V3 HOT 4
- Cannot install in macOS using brew HOT 4
- Cannot initialize secman config in `windows` HOT 2
- Incomplete string escaping or encoding HOT 2
- configure `goreleaser` for secman HOT 1
- When the user is not authenticated... HOT 3
- Bug in ubuntu/debian package file (`.deb`) HOT 4
- build `.devcontainer` for secman HOT 1
- Add spinner to `upgrade` command HOT 1
- Fetching in windows HOT 2
- Create Our Own `API` Website HOT 6
- Build secman website app HOT 1
- Add `GitLab` support to `secman` HOT 2
- create `secman` snap package
- redesign `secman` HOT 1
- The CheckList
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from secman.