firebase-admin 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 20dc769e214cf7c48d6b86d37bd17d0b806fada175e90e538fb728645d31e3ea
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 885264043ab60ad951e9b9ddb2785e2d9710523ce1d342b82851899a720f362d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5c2f316c8753ab8e3855e45f08fa0355c40cb31a9bf4127de53f4d51761f801b1ed2c8313d7c4b19cfc597e1b4f2680259d4193d60bfd2a836d6d3c06adf7058
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d79b0c5cff44a1de0b96474680f88440ddfe9c5942045437a63e1b6346961371d6cf1866331fbfa078f7b281351c219e962c351906b2309c2556024baf38e5dc
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
| 
         @@ -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
         
     | 
| 
         @@ -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. 
     | 
| 
      
 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- 
     | 
| 
      
 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
         
     |