Commit Graph

733 Commits

Author SHA1 Message Date
Kiril Videlov
819b327973
virtual branches controller - remove state dependency to credentials controller 2024-07-06 17:03:46 +02:00
Kiril Videlov
c777431363 remove the gitbutler generated key flow 2024-07-05 15:56:24 +02:00
Kiril Videlov
3e01e86701
remove with_verify_branch middleware closures 2024-07-04 17:12:20 +02:00
Kiril Videlov
82dd580c27
move the updating of "last fetch timestamp" logic
Removing the updating of project from the virtual branch controller - this is the only dependency between the two controllers and likely indicates that the "last fetched at" should live somewhere else.
It will serve us well to not mutate the project state from the virtual branches domain
2024-07-04 16:34:53 +02:00
Kiril Videlov
dfd15dc821
remove unused function 2024-07-04 15:36:36 +02:00
Kiril Videlov
fe7f1167bf
virtua branches controller - rm deps on project controller 2024-07-04 15:26:10 +02:00
Kiril Videlov
babfa974ce
remove unnecessary lifetime annotations 2024-07-04 13:31:08 +02:00
Kiril Videlov
3dded08458
simplify virtual branches controller deps graph
users controller is not a real dependency
2024-07-04 13:28:17 +02:00
Kiril Videlov
6add0a40cc
remove unnecessary user dependency 2024-07-04 13:09:04 +02:00
Kiril Videlov
5e18071a30
refactor: virtual branch controller - rm inner pattern 2024-07-04 12:21:22 +02:00
Caleb Owens
2d0dc3a9ff Better filter branches to unapply in case of conflicts 2024-07-03 14:57:18 +02:00
Caleb Owens
49236707be Use correct headers for unapplying wip commits 2024-07-02 17:30:00 +02:00
Kiril Videlov
8e3601e855 Merge: resolve lockfile conflicts 2024-07-02 16:21:54 +02:00
Kiril Videlov
88da873128
Merge pull request #4184 from gitbutlerapp/bundle-as-RPM
make RPM bundles
2024-07-02 15:54:42 +02:00
Caleb Owens
ac4f3b926c
Merge remote-tracking branch 'origin/master' into ndom91/create-gitbutler-ui-package 2024-07-02 15:31:00 +02:00
Kiril Videlov
1ac47405fc
fix clippy warning about missing crossbeam feature 2024-07-02 15:14:40 +02:00
Kiril Videlov
6e8e6b7b9b
remote unneccesary borrow 2024-07-02 15:11:28 +02:00
Kiril Videlov
23503afd25
merge stuff 2024-07-02 15:05:56 +02:00
Sebastian Thiel
b8da62c68b
assure SecretServices functions
- inject secretService so it works when used directly
- remove console logs
- only remove a migrated secret (instead of removing it unconditionally)
- in +template, await for good measure, which explains why the parent function is async

In the backend:
- prevent concurrency in method that stores secrets from the frontend
  as it's racy otherwise to type a secret quickly.
2024-07-02 13:17:45 +02:00
Caleb Owens
44e56ac370
Use turbo for production builds 2024-07-02 13:15:26 +02:00
Kiril Videlov
25aceb2520
rm unnecessary borrows 2024-07-02 11:22:08 +03:00
Kiril Videlov
a240a16cc5
silence clippy for now 2024-07-02 11:18:41 +03:00
Nico Domino
4fab3ec200
Merge branch 'master' into ndom91/create-gitbutler-ui-package 2024-07-02 10:04:46 +02:00
Sebastian Thiel
05506f49fa
migrate AI tokens from the git-configuration to the keystore.
All AI related options are stored in the user-level git configuration
file. Upon first access, they will be removed from there and placed
into the keystore as part of the migration.

The UI is provided with functions to store and save secrets which it
will use specifically to interact with these keys.

It's explicitly out of scope to *not* show the keys in plain-text
anymore after entering them.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
de00e4f049
support global secrets (without namespace for build types) and provide commands in tauri crate
That way globals secrets can be used from the UI directly.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
b08a9e8cb1
Prevent MacOS popups each startup on MacOS
MacOS is the only known platform that exhibits this behaviour - if an app
is recompiled, the hash of the binary is used to identify it towards the keychain.
As this changes each time, the keychain will ask for permission, which is fair.

However, it's also an impediment which leads to the implementation of
a keystore that uses git credentials as backend. For this to work,
the latest version of `gitoxide` is required for now.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
7e7555567b
automatically delete empty passwords from the key store
The frontend uses this to invalidate the GitHub token, even though
it can also deal with `null`. Let's keep the keystore clean and
only keep entries that contain an actual password.

Note that the consumers, i.e. the frontend, handle an empty password
for the short time it's in memory.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
9da051b089
improve naming of tokens stored in the keychain: do not 'abuse' user field
Currently, the user is used as handle name, but instead, just name it
`GitButler`.
2024-07-02 10:02:46 +02:00
Sebastian Thiel
fbfeba0637
auto-delete a user if its access token can't be found 2024-07-02 10:02:46 +02:00
Sebastian Thiel
ee5ff95649
Assure Sensitive fields can't be serialized
This does not only mean that they cannot be written to disk, but also
that extra work has to be done to serialize them over the wire.

This is very much by design, as they can be in structs that are
seemingly serializable and contain sensitive data, but they must
never actually be serialized.

For use in the UI, an extra type must be used that marks the secret
differently, for instance by field name.
2024-07-02 10:02:45 +02:00
Sebastian Thiel
bc8f3b74c7
tauri specializes the secret-store depending on application type
That way, there is no overlap in the technically global store, just
like before when secrets were stored in plain text.
2024-07-02 10:02:45 +02:00
Sebastian Thiel
929eb52224
auto-migrate secrets from user.json to their location in the keyring
This will also remove them from their plain-text location.

Further, when the secrets are required they will be obtained
specifically, instead of always having them at hand.

The frontend doesn't ever show these, but needs them, and
it now asks for them when it needs them.
2024-07-02 10:02:43 +02:00
Sebastian Thiel
f3e6c7ba94
Add the capability to store and retrieve secrets
This is a global facility without any state, and provides a simplified
interface to the `keyring` crate.
2024-07-02 10:01:44 +02:00
Sebastian Thiel
cedb893ad6
put 'core::serde' into its own module file
It started small, but now is large enough to warrant that.
2024-07-02 10:01:44 +02:00
Kiril Videlov
4db2698cda
bump tauri minor version
this allows us to bundle RPM packages!
2024-07-02 10:48:47 +03:00
Caleb Owens
82c3987d45
Unapply to real branches (#4025)
* Don't return optional

* Rename get_integration_commiter

* Add a header to wip commit

* Stuff

* Unapply all branches

* Reorder code

* Fix one test

* Name resolution

* Fix two tests

* Fix another!

* wip

* Fix so many tests

* Fix unapply.rs tests

* Fix selected for changes tests

* Move unapplying logic to delete_branch method

* Remove unused and kinda borked cherry_commit code

* Fix the tests!!!!!

* Make apply_branch private

* Change handling of headers

* Improve order integrity

* Updated types and comments to convey more meaning
2024-07-01 14:13:52 +00:00
ndom91
836b86a753
Merge branch 'master' into ndom91/create-gitbutler-ui-package 2024-06-28 12:50:44 +02:00
Kiril Videlov
b72f9c2199
move error marker out of virtual_branches mod
It's useful outside of it
2024-06-28 11:35:44 +02:00
ndom91
d8a7f2bbdc
fix: cleanup build npm scripts 2024-06-28 11:34:44 +02:00
Kiril Videlov
b623952fdd
Merge pull request #4198 from gitbutlerapp/remove-print-tree-function
refactor: Remove unused _print_tree function.
2024-06-28 11:21:26 +02:00
Kiril Videlov
8ed324580c
refactor: Remove unused _print_tree function. 2024-06-28 11:10:27 +02:00
Kiril Videlov
251d56677d
refactor: move rebase functions out of virtual_branches module
This opens the doors for further simplifying the core
2024-06-28 11:04:15 +02:00
Sebastian Thiel
adc50a7e7f
more robust login handling by deleting corrupt user.json file
If a user.json file cannot be loaded, delete it automatically
to avoid users to get stuck in 'something went wrong' during layout.

Older versions of GB wouldn't find the access-token in the user.json file
anymore, which would be completely removed via #4165
2024-06-27 15:10:48 +02:00
ndom91
091b45d5e9
feat: create separate component library subpackage 2024-06-26 18:01:09 +02:00
Kiril Videlov
b886ff84f1
refactor: Remove rusqlite dependency and related code. 2024-06-26 16:21:24 +02:00
Kiril Videlov
3fb7f3b8bb
add the ability to toggle the allow rebasing flag for lanes in the UI 2024-06-26 13:53:13 +02:00
Kiril Videlov
d17534d291
adds the ability to update the allow_rebasing flag on branches and fix tests 2024-06-26 10:23:31 +02:00
Kiril Videlov
d4267b81d5
use per-branch flag to check if rebasing is allowed 2024-06-25 21:36:43 +02:00
Kiril Videlov
4a0cf76b53
make RPM bundles 2024-06-25 20:44:11 +02:00
Kiril Videlov
03214dcaa1
introduce a new flag for branches determining if rebasing is allowed 2024-06-25 20:10:27 +02:00