Central registrar for DDR identifiers
denshoproject / ddr-idservice Goto Github PK
View Code? Open in Web Editor NEWCentral registrar for DDR identifiers
License: Other
Central registrar for DDR identifiers
License: Other
Note: This is the last version to support Python 2..
Step towards updating to Python 3. and Django 2.*.
http://www.django-rest-framework.org/api-guide/authentication/
Seealso
denshoproject/ddr-public#62
denshoproject/encyc-front#61
denshoproject/encyc-rg#64
get_noids()
counterpart to get_noid()
Timestamps in registrar.models.ObjectID
are not timezone-aware. Please.
$ python --version
Python 2.7.9
Archivist created entity ddr-densho-325-210 using ddr-local
, entered metadata and added master/mezz binaries.
She then clicked "create new object" but the "new" object ID was ddr-densho-325-210 again.
All the fields were blank, no master/mezz files present in the web ui. Master/mezz files were present in the back end.
No error messages. Bug has been replicated following the above steps.
Looks like ID service is issuing new IDs but not adding them to its backend store.
That is, the service will continue to issue the same ID over and over again to the ddr-editor webui.
If ID is added manually through the webadmin, it will issue the next ID properly.
There is a use-case where IDs (usually for a collection) may be manually assigned. The next automatically assigned ID should always be the lowest possible integer value, rather than the next highest after the manually assigned series.
Example case:
(Looks like the current next
logic is at: https://github.com/densho/ddr-idservice/blob/master/idservice/registrar/models.py#L165)
namesdb-editor
running on kyuzo
could not connect to local ddridservice
instance, also running on kyuzo
, when trying to add a new Person
.
Token-based authentication: Authorized API users should be able to make unlimited requests by authenticating with a token. Will also need rudimentary functionality to assign tokens and manage users.
http://www.django-rest-framework.org/api-guide/authentication/
DDR editor user requested new ID in one collection but got an object in a totally different collection. The new ID is actually created in the idservice, and the new object is actually created in the other collection repo. Problem is accompanied by timeouts when requesting new IDs.
The pattern seems to be that shorter collection ID integers (cid
) are acquiring extra digits.
For example:
Counterexamples:
registrar.models.ObjectID.next
must be able to handle collections, entities, and segments. It currently makes some assumptions that make it unable to handle segments.
IDservice is not returning IDs for new collections
idservice runserver
--------------------
[10/Aug/2017 13:50:20] "GET /api/0.1/rest-auth/user/ HTTP/1.0" 200 105
[10/Aug/2017 13:50:22] "POST /api/0.1/objectids/ddr-testing/next/collection/ HTTP/1.0" 500 27
idservice.log
--------------------
2017-08-10 13:50:22,016 DEBUG [views.next_object] next_object(<rest_framework.request.Request object at 0x7ff67957a950>, ddr-testing, collection)
2017-08-10 13:50:22,040 ERROR [exception.handle_uncaught_exception] Internal Server Error: /api/0.1/objectids/ddr-testing/next/collection/
Traceback (most recent call last):
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner
response = get_response(request)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 483, in dispatch
response = self.handle_exception(exc)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 443, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/views.py", line 480, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/rest_framework/decorators.py", line 52, in handler
return func(*args, **kwargs)
File "/usr/local/src/ddr-idservice/idservice/registrar/views.py", line 90, in next_object
next_object = ObjectID.next(oi, model)
File "/usr/local/src/ddr-idservice/idservice/registrar/models.py", line 195, in next
last = identifier.max_id(model, identifiers)
File "/usr/local/src/ddr-idservice/venv/idservice/local/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/identifier.py", line 762, in max_id
raise Exception('New id not in given list: %s' % oi)
Exception: New id not in given list: <DDR.identifier.Identifier collection:ddr-densho-40030>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.