firebase-admin 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e17ee3117fba2303b9994810707260adc620a0df6856fafcab5f2d91ae73d198
4
- data.tar.gz: 1b8cb745fdcb281555ba1210ae46de28d88adbe32fd0a3eb4f28b4dffa0bf579
3
+ metadata.gz: 20dc769e214cf7c48d6b86d37bd17d0b806fada175e90e538fb728645d31e3ea
4
+ data.tar.gz: 885264043ab60ad951e9b9ddb2785e2d9710523ce1d342b82851899a720f362d
5
5
  SHA512:
6
- metadata.gz: 3b477554cecc66c68eca389b9a6b1b1b406e3279c73fab7be20c1435f53e688338c8df6093e7ea2196a27ef21b82335ff7345cbb15670b2bc33b187fd76d94f6
7
- data.tar.gz: eeb3c9e88e13fb973c051d3c8d389f0870b48fb27f372ab36733a0f51247291499afaee4a971c2a18ef2068aa5fd4fc619983a985550d5b6ab96e4443ad4b091
6
+ metadata.gz: 5c2f316c8753ab8e3855e45f08fa0355c40cb31a9bf4127de53f4d51761f801b1ed2c8313d7c4b19cfc597e1b4f2680259d4193d60bfd2a836d6d3c06adf7058
7
+ data.tar.gz: d79b0c5cff44a1de0b96474680f88440ddfe9c5942045437a63e1b6346961371d6cf1866331fbfa078f7b281351c219e962c351906b2309c2556024baf38e5dc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- firebase-admin (0.2.0)
4
+ firebase-admin (0.3.0)
5
5
  addressable (~> 2.7)
6
6
  faraday (~> 1.3)
7
7
  faraday_middleware (~> 1.0)
@@ -63,6 +63,20 @@ module FirebaseAdmin
63
63
  post("v1/projects/#{project_id}/accounts:update", params)
64
64
  end
65
65
 
66
+ # DELETES the account completely from firebase. Once deleted we can retreive the account
67
+ # Need to be used cautiously
68
+ #
69
+ # @return 200 OK
70
+ # @see https://firebase.google.com/docs/reference/rest/auth
71
+ #
72
+ # @param localId [String] profile ID
73
+ def delete_account(localId)
74
+ params = {'localId': localId}
75
+ path = "v1/projects/#{project_id}/accounts:delete"
76
+ post path, params
77
+ end
78
+
79
+
66
80
  # Sign in with a password
67
81
  #
68
82
  # @param params [Hash] A customizable set of params
@@ -1,3 +1,3 @@
1
1
  module FirebaseAdmin
2
- VERSION = '0.2.0'.freeze unless defined?(::FirebaseAdmin::VERSION)
2
+ VERSION = '0.3.0'.freeze unless defined?(::FirebaseAdmin::VERSION)
3
3
  end
@@ -35,6 +35,22 @@ describe FirebaseAdmin::Client do
35
35
  end
36
36
  end
37
37
 
38
+ describe '.delete_account' do
39
+ before do
40
+ stub_post('v1/projects/test-project/accounts:delete')
41
+ .to_return(body: fixture('delete_account.json'), headers: { content_type: 'application/json; charset=utf-8' })
42
+ end
43
+
44
+ it 'should post to the delete endpoint' do
45
+ client.delete_account('local-id')
46
+ expect(
47
+ a_post('v1/projects/test-project/accounts:delete')
48
+ .with(body: { localId: 'local-id'}.to_json)
49
+ .with(headers: { 'Authorization' => 'Bearer owner' })
50
+ ).to have_been_made
51
+ end
52
+ end
53
+
38
54
  describe '.create_custom_token' do
39
55
  context 'when credentials are set via GOOGLE_APPLICATION_CREDENTIALS' do
40
56
  before do
@@ -0,0 +1 @@
1
+ { "kind": "identitytoolkit#DeleteAccountResponse"}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firebase-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Harris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-22 00:00:00.000000000 Z
11
+ date: 2022-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -185,6 +185,7 @@ files:
185
185
  - spec/fixtures/400_error.json
186
186
  - spec/fixtures/bad_gateway.html
187
187
  - spec/fixtures/create_account.json
188
+ - spec/fixtures/delete_account.json
188
189
  - spec/fixtures/example_key
189
190
  - spec/fixtures/gateway_timeout.html
190
191
  - spec/fixtures/google_credentials.json
@@ -223,6 +224,7 @@ test_files:
223
224
  - spec/fixtures/400_error.json
224
225
  - spec/fixtures/bad_gateway.html
225
226
  - spec/fixtures/create_account.json
227
+ - spec/fixtures/delete_account.json
226
228
  - spec/fixtures/example_key
227
229
  - spec/fixtures/gateway_timeout.html
228
230
  - spec/fixtures/google_credentials.json