29 Commits

Author SHA1 Message Date
df78b24542 GitHostRepo: Add name and username
Instead of having to parse this from the fullName. This way the code is
easier to read and it's more reliable.
2020-11-13 15:36:24 +01:00
da459c65e3 NNBD: try fixing some of the errors 2020-09-13 20:52:16 +02:00
9e045519bb Add tests for GitHub & GitLab apis for fetching the list of repos 2020-09-05 11:18:54 +02:00
ccf5f65e55 List Repos: Print the http req as curl
Makes it easier to test
2020-09-05 11:03:15 +02:00
e4fd84d4a4 RepoList: Parse more information
This way in the future we can make the repo list a bit prettier. It
currently looks quite ugly.
2020-09-03 20:54:46 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
66a76a0767 Revert "Use flutter_web_auth instead of our own OAuth mechanism"
This reverts commit 763cbf8493c610dec0e7e344bee40ad331e7a272.
This reverts commit ddad699b259bafe6c7ed630e7afc2eb38b7825e6.

This is causing way too many problems -

On Android with GitHub we occasionally get a User Cancelled exception.
On iOS this doesn't work < ios11

I prefer keeping my way till then. Even though it doesn't support
KeepAlive on Android.
2020-06-10 11:53:43 +02:00
763cbf8493 Use flutter_web_auth instead of our own OAuth mechanism
This works slightly better on iOS and on Android it has a keep alive,
which will prevent our app from being killed. Additionally, this way
there is less for me to maintain, which is always nicer.

The API for flutter_web_auth is also much simpler.

This also inolves some custom logic for parsing the Query Parameters
from the GitLab callback, as it doesn't seem to be a proper URI. Not
sure what is going on with Gitlab.
2020-06-09 17:09:38 +02:00
18db4899b2 GitHostSetup: Allow the user to choose between repos
This way they don't need to use a repo called 'journal'.
2020-05-15 15:28:44 +02:00
bb0e574495 Abstract out the logging
This way moving away from Fimber will be much easier.
2020-04-04 11:50:57 +02:00
f119e60b79 OAuth: close the webview explicitly afterwords
Hopefully this will fix the problem on iOS
2020-04-02 17:21:25 +02:00
1741fbf458 GitHub: Use http authentication header
Passing the oauth token via the query parameter has been deprecated and
will be removed on the 1st of July.
2020-02-09 16:32:35 +01:00
74d7bdd763 Use a proper logger - Fimber
It's time to start using a proper logger so we can control the number of
log messages, also - it helps to have a central configuration point for
the logs, specially since I would like to hook them up to Crashlytics in
the future.
2019-06-19 09:45:15 +02:00
d653663a47 Change Git dart API
Use a class instead of a many functions. This way we avoid passing the
same arguments again and again.
2019-06-17 19:38:56 +02:00
c79249cbe1 Dart: Give all functions explicit types
It makes the code easier to understand and this way the static type
checker will catch bugs for us.
2019-06-02 15:51:43 +02:00
9ce4e5b1b9 DartLinter: Add prefer_collection_literals 2019-02-23 01:36:32 +01:00
8ff5d02033 DartLinter: Add unnecessary_this 2019-02-23 01:33:34 +01:00
06dc62e967 GitSetup: Use the 'journal' repo if it already exists 2019-02-14 11:06:49 +01:00
c5c4d44431 GitHost: Improve error handling
In the case of OAuth errors which we get through the message
channel, throwing an exception doesn't help us as the init function
will not be aware about it.

So for now, I've moved the nodejs style error handling in this
particular case.
2019-02-13 22:43:34 +01:00
acede95536 Dart: Add analysis_options
For now I've mostly tried to follow the same style guide as the flutter
repository, with many options disabled. Eventually, maybe it would make
sense to be far stricter.
2019-02-13 13:08:15 +01:00
dc29d523cc GitSetup: Get the user's name + email from the GitHost
This way they aren't committing under the name of 'GitJournal'.
2019-02-09 16:47:53 +01:00
8e9e3a91b5 GitHosts: Throw RepoExists exception 2019-01-25 15:11:09 +01:00
86f01ab7d1 GitHosts: Improve error handling 2019-01-25 15:03:42 +01:00
fb202e0f1f GitHost AutoConfigure: Handle errors a bit better 2019-01-25 14:52:56 +01:00
ac5c2be05d Add a GitHost interface
GitLab and GitHost are two implementations of that interface.
2019-01-25 11:21:58 +01:00
4c1009f42f OnBoarding: Add auto-configure mode for Github
In this mode the user doesn't need to do anything but give the
GitJournal app permissions, and then it will go and create the repo, add
the ssh key and everything.

This currently does not work for Gitlab.
2019-01-24 16:45:40 +01:00
136713dc1e Github: Remove unnecessary braces 2019-01-24 15:30:55 +01:00
d87085ac29 GitHub API: Refactor it into a class 2019-01-24 15:28:04 +01:00
fbdb4d61ed Add an OAuth GitHub api
This just models the basic API that we need for GitJournal. The API
isn't great and could use improvement.

Also, yes, I know I'm committing the secret key, but I don't see any
other way of managing this. GitHub doesn't allow the implicit oauth flow
or dynamic clients registration or anything. So there isn't really any
other way.
2019-01-24 13:50:06 +01:00