Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a7d093b
Added DWIM-y processing of param names for {+params}
rabbiveesh Dec 12, 2018
e61c23b
Added tests and docs for new feature
rabbiveesh Dec 13, 2018
480f98c
Fixed perlcritic complaint
rabbiveesh Dec 13, 2018
1da26c4
squashed bug introduced and added test
rabbiveesh Dec 15, 2018
2bb1f8e
Added global parameters like 'fields' support
rabbiveesh Dec 15, 2018
602eeab
Added test for global param support
rabbiveesh Dec 16, 2018
872919c
cleaned up tests more
rabbiveesh Nov 21, 2019
47536b0
Made service accounts work
rabbiveesh Nov 21, 2019
55b4d85
Fixed up JWT for dzil
rabbiveesh Nov 22, 2019
a332dd9
ignore vim temp files
rabbiveesh Nov 23, 2019
85633e8
began making notes for changes and tapping out the service account
rabbiveesh Nov 23, 2019
fcb1128
fixed up missing important test files
rabbiveesh Nov 23, 2019
4b0c698
started TODO file
rabbiveesh Dec 25, 2019
ba67806
switched perltidy to my tastes
rabbiveesh May 26, 2020
080f4e1
cleaned up code (A LOT!)
rabbiveesh May 27, 2020
6e6ab17
continuing this sweet refactor
rabbiveesh May 27, 2020
4860831
updated gitignore to allow .yath.user.rc for testing w/ real creds
rabbiveesh Aug 5, 2020
31a27c2
fix up tests which depended on outside sources
rabbiveesh Nov 4, 2020
0544e57
Merge branch 'rabbiveesh/service_account' of https://github.com/rabbi…
rabbiveesh Nov 4, 2020
8599d96
bump version
rabbiveesh Nov 4, 2020
d5e6f44
bumped version
rabbiveesh Nov 4, 2020
f12630f
add Git::CommitBuild plugin
rabbiveesh Nov 5, 2020
11a1b35
fix tests to work with google updates and newer JWT uses
rabbiveesh Jan 18, 2021
5bc8e0c
fix up random warning from test
rabbiveesh Jan 18, 2021
82d81b5
Remove this implementation of JWT::Google in favor of our CPAN one
rabbiveesh Jan 21, 2021
305b082
fix up some typos, take notes
rabbiveesh Jan 21, 2021
ab8b88c
begin sketching out service accounts from user's perspective
rabbiveesh Jan 21, 2021
a4957a7
continue setting up the chain to load service account storage
rabbiveesh Jan 21, 2021
ad7e854
cosmetics
rabbiveesh Jan 21, 2021
f5e8b2a
spellcheck goauth, not go_auth
rabbiveesh Jan 21, 2021
720071f
start making ::Client::AuthStorage a role
rabbiveesh Jan 21, 2021
95fb41c
make all uses of auth_storage->storage skip the indirection
rabbiveesh Jan 21, 2021
73ad266
remove unnecessary 'is_set' attr from AuthStorage classes
rabbiveesh Jan 21, 2021
5b783f3
rename scopes throughout the code
rabbiveesh Jan 22, 2021
11811d2
put in filler deprecation code
rabbiveesh Jan 22, 2021
b9dffec
move functionality of ::Credentials to the AuthStorage role
rabbiveesh Jan 22, 2021
1bc7316
rename AccessToken class
rabbiveesh Jan 23, 2021
50e311f
always call get_access_token, don't have a access_token attr
rabbiveesh Jan 23, 2021
0d7e145
implement refresh_access_token for a user
rabbiveesh Jan 23, 2021
8ec687f
remove auto_update_tokens_in_storage option
rabbiveesh Jan 23, 2021
a3624c2
almost done implementing service accoutns
rabbiveesh Jan 23, 2021
c498908
service account is working!
rabbiveesh Jan 23, 2021
149a5b8
update dist.ini and TODO
rabbiveesh Jan 23, 2021
f415e9d
start working on the POD
rabbiveesh Jan 23, 2021
26cf646
allow auth_storage argument to main object
rabbiveesh Jan 23, 2021
aefa66c
document AccessToken
rabbiveesh Jan 23, 2021
3b884a7
attach the token to the res
rabbiveesh Jan 23, 2021
733609b
sanity check for auth_storage
rabbiveesh Jan 23, 2021
25359a7
add better error messages for failure to refresh creds
rabbiveesh Jan 24, 2021
505095a
update test suite to Test2 and to use our test helpers
rabbiveesh Jan 24, 2021
10bedf5
some perltidy-ing and spelling errors in error messages
rabbiveesh Jan 24, 2021
0d6c1da
shorten long name to _process_params
rabbiveesh Jan 25, 2021
ff1b252
some notes on idiomaticy
rabbiveesh Jan 25, 2021
a10aa49
rename ::AuthStorage::ConfigJSON to ::AuthStorage::GapiJSON
rabbiveesh Jan 28, 2021
b76a126
document ::AuthStorage::GapiJSON.pm
rabbiveesh Jan 28, 2021
f01e8c9
finish doc-ing GapiJSON.pm
rabbiveesh Jan 28, 2021
3928c83
start keeping Changes manually with ::Plugin::NextRelease
rabbiveesh Jan 28, 2021
20d6b4f
document ::AuthStorage::ServiceAccount.pm
rabbiveesh Jan 28, 2021
9199fda
fix up docs for goauth
rabbiveesh Jan 28, 2021
a3ee6b1
move network access methods to ::AuthStorage
rabbiveesh Jan 28, 2021
9b09ee5
rip out unused deps
rabbiveesh Jan 28, 2021
b5debb2
change version plugin to allow perl critic
rabbiveesh Jan 28, 2021
438601c
now we're passing perl critic
rabbiveesh Jan 28, 2021
b38dbf5
finish tapping out details on the xt live test
rabbiveesh Jan 28, 2021
d962541
finish writing simple live test
rabbiveesh Jan 28, 2021
a06593e
make get_method_details die, like it should
rabbiveesh Jan 28, 2021
3c82d69
fix t/05 (at least for now!)
rabbiveesh Jan 28, 2021
a03f79c
finish the tests! ready to ship!
rabbiveesh Jan 28, 2021
c884973
last little fix for dist.ini
rabbiveesh Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ examples/*.png
**/delme*
*.json
docs/cover/*

.yath.user.rc
.*.sw?
.perl-version
33 changes: 17 additions & 16 deletions .perltidyrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
-pbp -nst # Start with Perl Best Practices - not sure how to drive and cuddles my braces
-w # Show all warnings
-iob # Ignore old breakpoints
-l=180 # 80 characters per line
-mbl=2 # No more than 2 blank lines
-i=2 # Indentation is 2 columns
-ci=2 # Continuation indentation is 2 columns
-vt=0 # vertical tightness
-pt=0 # parenthesis tightness
-bt=0 # brace tightness
-sbt=2 # square bracket tightness
-wn # Weld nested containers
-isbc # Don't indent comments without leading space
-sbl # sub-brace on new line
-bl # Opening Braces Left
-b -bext='/' # operwrite the file and delete backup if no errors
--warning-output
--ignore-old-breakpoints
--maximum-line-length=80
--maximum-consecutive-blank-lines=2
--indent-columns=2
--continuation-indentation=2
--vertical-tightness=0
--paren-tightness=2
--brace-tightness=1
--square-bracket-tightness=2
--weld-nested-containers
--indent-spaced-block-comments
--cuddled-else
--trim-qw
--opening-brace-always-on-right
--opening-token-right
-b # overwrite the file
26 changes: 21 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# When hacking on this repo

There are some live tests in `xt/` which require real user credentials. All they
do is create a file in Google Drive, and then delete it, in order to make sure that
things are ACTUALLY running.

If you don't trust me, then please don't run those tests. They're part of the
release process, so I'll just run them before releasing.

If you DO trust me (and I'm flattered), then you need to set the
`GAPI_XT_USER_CREDS` environment variable to a string containing the gapi.json
file, followed by `:` followed by the user to user. Like this:

/absolute/path/to/gapi.json:your_email@gmail.com

And also set the `GAPI_XT_SERVICE_CREDS` to the service account file downloaded
from Google.

# Bug Reporting and General Help Requests

- Use the [Github Issues Page](https://github.com/pscott-au/WebService-GoogleAPI-Client/issues)
- Use the [Github Issues Page](https://github.com/rabbiveesh/WebService-GoogleAPI-Client/issues)

## Github Repo Management

Expand All @@ -10,8 +28,6 @@

# CONTRIBUTING CODE

- Use perlcritic and perltidy if my bracer style is offensive
- This is my first module using dzilla to package a module - I'm not completely sold on it and may be using it incorrectly - advice on improving usage welcome
- There remain a few architectural bad smells from the original source code this was based on - don't assume that the class structure is sane
- Pull reqeusts preferred but whatever works for you I will try to work with

Expand All @@ -21,11 +37,11 @@
- refactor to improve test coverage
- clean up the test structure
- survey other Google Perl modules
- explore handling of batch requests
- implement batch requests - really an interface question more than the
technicalities
- API worked examples with help functions
- ability to examine CHI cache and introspect on Client instance metrics ( number of HTTP calls, cache size, TTL data sent/received etc )
- comparison with other language Client libraries
- The structure under the AuthStorage is ugly and needs some love


Github Repo: [https://github.com/pscott-au/WebService-GoogleAPI-Client]
Expand Down
14 changes: 14 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{$NEXT}}

ENHANCEMENTS
- add support for service accounts
- rework storage backend to allow custom implementations (here's looking at you, redis)
- allow introspection for credentials on $res returned from an api query

BREAKING CHANGES
- will immediately on non-existent API endpoints
- rework AuthStorage classes: anything that depended on
::AuthStorage or ::Credentials in an undocumented way will likely explode.
Please open an issue on github and I'll try and help you migrate
- remove some undocumented options
- the examples/ dir MAY be broken, I didn't check (they need cleaning up anyways)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ I was unable to get the [Dist::Zilla](https://metacpan.org/pod/Dist::Zilla) pack
my $gapi = WebService::GoogleAPI::Client->new(debug => 0);

## This idiom selects the first authorised user from gapi.json
my $aref_token_emails = $gapi->auth_storage->storage->get_token_emails_from_storage;
my $aref_token_emails = $gapi->auth_storage->get_token_emails_from_storage;
my $user = $aref_token_emails->[0];
print "Running tests with default user email = $user\n";
$gapi->user($user);
Expand Down Expand Up @@ -222,7 +222,7 @@ See the examples folder for specific access examples.
- API Discovery with local caching using [CHI](https://metacpan.org/pod/CHI) File
- OAUTH app credentials (client\_id, client\_secret, users access\_token && refresh\_token) storage stored in local gapi.json file
- Automatic access\_token refresh (if user has refresh\_token) and saving refreshed token to storage
- CLI tool ([go_auth](https://metacpan.org/pod/distribution/WebService-GoogleAPI-Client/bin/goauth)) with lightweight HTTP server to simplify config OAuth2 configuration, sccoping, authorization and obtaining access\_ and refresh\_ tokens
- CLI tool ([goauth](https://metacpan.org/pod/distribution/WebService-GoogleAPI-Client/bin/goauth)) with lightweight HTTP server to simplify config OAuth2 configuration, sccoping, authorization and obtaining access\_ and refresh\_ tokens


# SEE ALSO
Expand Down
Loading