-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Swift backend support #207
base: main
Are you sure you want to change the base?
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing licence on imported files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error conditions should halt execution. add a return
here and after all ctx->set_error calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct author?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No 😅
…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.