Git Product home page Git Product logo

pscouchdb's People

Contributors

matteoguadrini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pscouchdb's Issues

PSCouchDBAttachment class bug

Description

File attachment that it does not have CRLF’s.
We’re finding that CRLF’s are stripped out of the file, and this causes us issues sometimes. (If we upload the file manually into Fouxton, we don’t have the issue.)

Steps to Reproduce

Add-CouchDBAttachment -Database $Database -Document $RecordId -Revision $Document._rev -Attachment $filename -Authorization $Authorization

VERBOSE: Set method to GET
VERBOSE: Set database to hardware_firmwaretype
VERBOSE: Set document to 1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
VERBOSE: Add authorization
VERBOSE: Request to CouchDB server:
GET /hardware_firmwaretype/1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
Host: localhost:5984
Param:


VERBOSE: Set method to PUT
VERBOSE: Set database to hardware_firmwaretype
VERBOSE: Set document to 1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
VERBOSE: Set attachment to HardwareData/FirmwareType/I++/OriginalFile.FirIL
VERBOSE: Set revision to 71-9f348007305aa351124872a1d2b208a8
VERBOSE: Set parameters: rev=71-9f348007305aa351124872a1d2b208a8
VERBOSE: Add authorization
VERBOSE: Request to CouchDB server:
PUT /hardware_firmwaretype/1ca6f867-8295-456a-b7d9-b36f5cfa3f3b/OriginalFile.FirIL
Host: localhost:5984
Param: ?rev=71-9f348007305aa351124872a1d2b208a8

Powershell Exception

None

Method used

Add-CouchDBAttachment -> Send_CouchDBRequest -> PSCouchDBRequest -> AddAttachment(...)

Expected Behaviour

When I download file attachment, has a CRLF’s.

Your Environment

  • PSCouchDB version used: 2.4 -- 2.3.4
  • Operating System and version: Windows/Linux/Mac OS

Authorization fails with passwords containing special chars

Description

Cmdlets raise an Error whenever the authorization param contains chars like -, ! in password

Steps to Reproduce

Get-CouchDBDatabase -Database 'foobar' -Sever 'couch.any.io' -Port 5984 -Authorization 'user:foo-bar!'

Powershell Exception

Authorization string must be this format: "user:password"
In C:\Program Files\WindowsPowerShell\Modules\pscouchdb\2.3.0\PSCouchDB.psm1:1466 Zeichen:13
+             throw [System.Text.RegularExpressions.RegexMatchTimeoutEx ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], RegexMatchTimeoutException
    + FullyQualifiedErrorId : Authorization string must be this format: "user:password"

This is traceback exception:

Expected Behaviour

Description of what is expected

Your Environment

  • PSCouchDB version used: 2.3.0
  • Operating System and version: win 10 1909

Additional context

Cmdlet fails for CouchDB host with sub dir

Description

Cmdlets like Export-CouchDBDatabase seems to parse the uri wrong for cases where the CouchDB host is published by a reverse proxy like https://generic.host.io:443/couch/<db>/<doc>

Steps to Reproduce

image

Powershell Exception

This is traceback exception:

Expected Behaviour

The port itself should be added in the URIs host field an not appended after the path.

Your Environment

  • PSCouchDB version used: 2.3.0
  • Operating System and version: Win 10 1909

Additional context

Export & Import cmdlet error due to file format issue

📓 Description

Using Import-CouchDBDatabase fails due to json format error generated by ExportDBDatabase.

🛠️ Steps to Reproduce

Export-CouchDBDatabase -Server 'old.couch.io' -Database 'stats' -Verbose -Port 5984 -Authorization (Get-Credential) -Path '.\stats.json'
Import-CouchDBDatabase -Server 'new.couch.io' -Port 443 -Ssl -Database 'stats' -Path .\stats.json -Authorization (Get-Credential) -Verbose -RemoveRevision

🐛 PowerShell Exception

This is traceback exception:

[400] Bad Request: Bad request structure. The error can indicate an error with the request URL, path or headers.
CouchDB Response -> Bad Request
In C:\Program Files\WindowsPowerShell\Modules\pscouchdb\2.3.2\PSCouchDB.psm1:1334 Zeichen:13
+             throw ([PSCouchDBRequestException]::New($errcode.StatusCo ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: ([400] Bad Reque... -> Bad Request:String) [], RuntimeException
    + FullyQualifiedErrorId : [400] Bad Request: Bad request structure. The error can indicate an error with the reque
   st URL, path or headers.
CouchDB Response -> Bad Request

✨ Expected Behaviour

Description of what is expected

💻 Your Environment

💡 Powershell 5.1 on any Windows system

  • PSCouchDB version used: 2.3.2
  • Operating System and version: Any Windows based

🔖 Additional context

🧙 PowerShell / Filehandler writes the json ouput file in UTF8 BOM, If you manually change the encoding to utf8 without BOM the import works!

Lack of HTTPS

No clear way to enable HTTPS communication. It appears HTTP is set via $url in Send-CouchDBRequest and New-CouchDBReplication. Can we add a parameter to use HTTPS?

New-CouchDBDocument "Document must be a JSON object"

When adding a new Document and the -data param is provided actual JSON data "Document must be a JSON object" is thrown.

eg:
$data = Get-Service | select name; $data = $data | convertto-json -compress
New-CouchDBDocument -Server server -Database test -Document "test" -Data $data

Invoke-RestMethod : {"error":"bad_request","reason":"Document must be a JSON object"}
At C:\Program Files\WindowsPowerShell\Modules\PSCouchDB\1.6.0\PSCouchDB.psm1:444 char:16

  • $results = Invoke-RestMethod @options
    
  •            ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.