Conversation
…nd swift-client libraries
|
I used these libraries as a baseline to access swift/keystone:
I'd love to have some feedback on how I integrated it into mapcache. Currently this functionality is not really tested in production, so this PR stays a draft. keystone-client uses json-c (added as cmake dependency), I'm not sure if this is done correctly. I'm aware, that mapcache ships with its own JSON implementation (cJSON), but I did not yet make an effort to replace either. |
tbonfort
left a comment
There was a problem hiding this comment.
Not going into the actual swift logic, here are a few comments. The error checking and connection pool releasing applies to the whole cache_swift.c file, not just the reviewed lines.
| @@ -0,0 +1,200 @@ | |||
| #ifndef KEYSTONE_CLIENT_H_ | |||
There was a problem hiding this comment.
Missing licence on imported files
There was a problem hiding this comment.
Right!
Besides: Do you think that it is alright to include a source file like that? The repo says it is GPL v3.
|
|
||
| keystone_err = keystone_authenticate(conn->keystone_context, cache->auth_url, cache->tenant, cache->username, cache->password); | ||
| if (keystone_err != KSERR_SUCCESS) { | ||
| ctx->set_error(ctx, 500, "failed to keystone_authenticate()"); |
There was a problem hiding this comment.
error conditions should halt execution. add a return here and after all ctx->set_error calls
There was a problem hiding this comment.
I will check all possible paths and fix these issues.
lib/cache_swift.c
Outdated
| } | ||
| } | ||
|
|
||
| mapcache_connection_pool_release_connection(ctx, pc); |
There was a problem hiding this comment.
This should be called before all exit paths (i.e. it is currently not called on error condition exits)
There was a problem hiding this comment.
Right, I'll need to check those as-well.
lib/cache_swift.c
Outdated
| * | ||
| * Project: MapServer | ||
| * Purpose: MapCache tile caching support file: swift cache backend. | ||
| * Author: Michael Downey and the MapServer team. |
…atus codes >= 400.
|
I updated the source code and now support keystone v3 API. With This points to an issue in |
|
I think I found the issue, a classic buffer overflow (re-)allocating This PR is good to go from my perspective. @tbonfort please let me know if need anything in addition. |
|
Have you figured out the causes of failed checks? |
|
Yes, I think I solved the issues |
|
I've checked your updates following @tbonfort's comments and it looks OK in my opinion. About licenses, I think there is nothing wrong with using LGPLv3 source code in a bigger MIT licensed project. I don't know the prefered way of mentioning it: copy license text at the beginning of related code (only swift-client.h and swift-client.c, since no license is mentioned in keystone-client repo), or include it in MapCache LICENSE file with a note indicating that only swift-client is concerned with LGPLv3. @jmckenna any advice on this? |
|
@jbo-ads I prefer the second option, but I think it should be noted in several places:
|
|
@constantinius - Please don't forget to update the documentation with this new feature: https://mapserver.org/mapcache/caches.html |
|
Unfortunately the latest commit breaks building for me: |
Adding OpenStack Swift cache backend using modified keystone-client and swift-client libraries.