Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can mint two ids for same object #12

Open
bheavner opened this issue Jun 14, 2018 · 2 comments
Open

can mint two ids for same object #12

bheavner opened this issue Jun 14, 2018 · 2 comments

Comments

@bheavner
Copy link

bheavner commented Jun 14, 2018

If I mint a minid two times in a row (same checksum, etc.), the server mints new minids both times - shouldn't the server refuse to make a new minid if the entity already exists?

httr::with_verbose(httr::POST(url, body = body, ua, encode = "json"))
-> POST /minid HTTP/1.1
-> Host: minid.bd2k.org
-> User-Agent: https://github.com/bheavner/minidtools
-> Accept-Encoding: gzip, deflate
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Content-Length: 368
-> 
>> {"test":"False","checksum_function":"sha256","checksum":"2958cdfafa3001be6db6f059f263cf98d359668611c6e425b9a79dc68a6ede69","email":"[email protected]","code":"argleflarg","title":"2_snv.tsv.gz","locations":["sftp://gap-upload.ncbi.nlm.nih.gov/exchange/Combined_Study_Data/Genotypes/freeze.5_annotation/WGSA_parsed/provisional/2_snv.tsv.gz"]}

<- HTTP/1.1 201 CREATED
<- Date: Thu, 14 Jun 2018 22:40:33 GMT
<- Server: Apache/2.4.7 (Ubuntu)
<- Content-Length: 43
<- Content-Type: application/json
<- 
Response [http://minid.bd2k.org/minid]
  Date: 2018-06-14 22:40
  Status: 201
  Content-Type: application/json
  Size: 43 B
{
  "identifier": "ark:/99999/fk4pg2wz61"

Here's my second minted minid for the same json:

httr::with_verbose(httr::POST(url, body = body, ua, encode = "json"))
-> POST /minid HTTP/1.1
-> Host: minid.bd2k.org
-> User-Agent: https://github.com/bheavner/minidtools
-> Accept-Encoding: gzip, deflate
-> Accept: application/json, text/xml, application/xml, */*
-> Content-Type: application/json
-> Content-Length: 368
-> 
>> {"test":"False","checksum_function":"sha256","checksum":"2958cdfafa3001be6db6f059f263cf98d359668611c6e425b9a79dc68a6ede69","email":"[email protected]","code":"argleflarg","title":"2_snv.tsv.gz","locations":["sftp://gap-upload.ncbi.nlm.nih.gov/exchange/Combined_Study_Data/Genotypes/freeze.5_annotation/WGSA_parsed/provisional/2_snv.tsv.gz"]}

<- HTTP/1.1 201 CREATED
<- Date: Thu, 14 Jun 2018 22:44:31 GMT
<- Server: Apache/2.4.7 (Ubuntu)
<- Content-Length: 43
<- Content-Type: application/json
<- 
Response [http://minid.bd2k.org/minid]
  Date: 2018-06-14 22:44
  Status: 201
  Content-Type: application/json
  Size: 43 B
{
  "identifier": "ark:/99999/fk4jq2655q"
@mikedarcy
Copy link
Collaborator

I thought the intention was to allow different users (identities) to create minids for the same object. It does seem redundant to allow the same user/identity to create a new minid for an object that they have already created one for. They should be updating that existing identifier rather than peeling off a new one. Maybe this is just a bit of missing logic on the backend?

@bheavner
Copy link
Author

I thought there was a check somewhere to see if the checksum already existed. It'd make sense to me to have a 1:1 mapping of checksums to minids, but a minid can have many locations... location-parsing is up to clients for now, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants