How to install additional python packages in Gluu - jython

There's a requirement for hashing/cryptography. While User onboarding one of the user's attributes needs to be persisted as a hash and during login the user-provided value must be checked with the hash. This is almost the same process done while using bcrypt encoders. I am trying to use hashlib. But this package is not by default in Gluu setup
import hashlib
dk = hashlib.pbkdf2_hmac('sha256', b'password', b'salt', 100000)
dk.hex()
How can I install hashlib inside Gluu?

Just unpack required library to ./opt/gluu/python/libs.
In my environment I just installed python package locally and copied directory with it to that folder

Related

How to debug neovim lsp custom command

I am attempting to get the volar vue language server to work in place of vetur for neovim's native lsp.
Using both lspconfig and lspinstall I was able to create a working custom install for sumneko_lua (unrelated but had to manually build due to some issues with the built-in :LspInstall lua). Below is that code duplicated and modified for an attempt at using this new vue server:
local vue_config = require'lspinstall/util'.extract_config('vuels')
vue_config.default_config.cmd = {'node', './node_modules/vscode-vue-languageservice/out/index.js', '--stdio'}
require'lspinstall/servers'.newvue = vim.tbl_extend('error', vue_config, {
install_script = [[
! test -f package.json && npm init -y --scope=lspinstall || true
npm install vscode-vue-languageservice#latest
]],
uninstall_script = nil
})
Running :LspInstall newvue installs properly, however :LspInfo shows this language server is attached to the buffer (of a .vue file) but not active. I believe the issue is with this path: ./node_modules/vscode-vue-languageservice/out/index.js. It exists, but may not be the correct entry point? The default vue ls simply has vls as the command because it provides a binary. Am I missing something in this package? I have yet to come across another language server without a single binary to pick out.
Thanks!
Can you try an absolute path to the out.js file? In my pretty elaborate config for a custom Volar install I'm using something just /home/myuser/dev/volar/packages/server/out/index.js (where the volar folder is just the whole volar cloned github repo). My full config is here
I don't think you can use relative paths like you did. I know you're assuming that the "./node_modules" means "workspace directory" but it's hard to tell in which directory nvim-lspconfig opens up those executables.
I have yet to come across another language server without a single binary to pick out.
Volar also provides a binary, it's volar-server (after running npm i -g #volar/server), it's just with a custom install (ie. alongside the real volar) you can't use it, because I assume you want to use your local install with custom code.
As for more indepth debugging/logging, you can check ~/.cache/nvim/lsp.log to see why the language server dies in detail.

.kaggle not found in C:/users/username/

I installed kaggle using pip install kagggle.I created a new API token but, .kaggle is not found in the location :C:/users/username/. Where do I store kaggle.json?

Importing Airflow Plugin

I am currently trying to push data from Salesforce to BigQuery using Airflow. I am new to airflow and currently I'm following this link:
https://github.com/TheF1rstPancake/airflow-salesforce
When I try to import the plugin
from airflow.operators import SalesforceToFileOperator,
I get the error message stating ImportError: cannot import name 'SalesforceToFileOperator'
How do I import this plugin on Airflow?
Current Directory Structure
DAGS
salesforce_bg.py
plugins
airflow-salesforce
__init__.py
hooks
operators
What am I doing wrong?
From the official Airflow documentation: here
The python modules in the plugins folder get imported, and hooks, operators, sensors, macros, executors and web views get integrated to Airflow’s main collections and become available for use.
So, you only need to place salesforce_bg.py into the /plugins folder of your Airflow server.

Would someone provide an example of Rest API call with user authentication and arguments passed in Robot test framework

The Get, Get request key words in requests library documentation does not provide any examples where user credentials/AUTH_TOKEN and other arguments passed in the API call.
As Bryan pinted, the examples are in the libraries tests.
For basic authentification, there is:
Get With Auth
[Tags] get get-cert
${auth}= Create List user passwd
Create Session httpbin https://httpbin.org auth=${auth} verify=${CURDIR}${/}cacert.pem
${resp}= Get Request httpbin /basic-auth/user/passwd
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal As Strings ${resp.json()['authenticated']} True
If you get No keyword with name 'Create Session' found., that means that you are not importing the library correctly or not having it installed correctly.
If you just running the testcase.txt, wrong import is the most like reason. It imports the keywords directly from the source file in author's local repository, instead of installed library package:
Library ../src/RequestsLibrary/RequestsKeywords.py
Instead, import it like in the examples in the librarie's GIT homepage/readme.MD
Library RequestsLibrary
If there is issue with installation, just do:
pip install -U requests
pip install -U robotframework-requests

Import org.apache.commons.io.FileUtils; not possible in latest apache poi.Instead import org.apache.tools.ant.util.FileUtils; is coming

In the latest Apache poi download(poi-3.15-beta2), while taking screenshot, I need to use FileUtils.copyFile. In its previous version, the imported package was import org.apache.commons.io.FileUtils;. In the latest download, this package is not coming, and it is giving error in my existing executable code. Now I tried to remove the previous import and it gave import org.apache.tools.ant.util.FileUtils;
Code:
FileUtils.copyFile(
scrFile,
new File(location+"LR_"+strDate+"_scr1.png")
);
Gives the error:
Cannot make a static reference to the non-static method
`copyFile(File, File)` from the type `FileUtils`
Apache POI never bundled or required Apache Commons IO, which contains the FileUtils class and so it seems some other project dragged in this code previously, but does not any longer. See http://poi.apache.org/overview.html#components for the list of third-party projects that Apache POI uses.
You should simply add a recent commons-io dependency to your project depending on which type of buildsystem you use, e.g. a normal dependency in Gradle/Maven or the actual jar-file if you have a buildsystem without full dependency-support.
Use the code below:
FileUtils.getFileUtils().copyFile(sourceFile, new File(directory + filename));
And import file should be:
import org.apache.tools.ant.util.FileUtils;