Giter VIP home page Giter VIP logo

reactivesearch-api's Issues

Error 401 (Unauthorized)

What version of ReactiveSearch API are you using ?

Lastest

What issue did you run into?

When configuring a remote elasticsearch the variables found in config/docker.env (username and password) don't work, I had to put the credentials in the url. Is there a way to not have to pass the credentials through the url?

What did you expect to see?

ES_CLUSTER_URL=https://my-elastic.com
USERNAME=username
PASSWORD=password

What did you see instead?

ES_CLUSTER_URL=https://username:[email protected]

Does it work with Kibana ?

I see this doesn't sit on top of the es unlike xpack or opendistro so I can not use

elasticsearch.username: and elasticsearch.password:

as mentioned in kibana docs
I tried to use basic auth by passing username and passwork in the url like http://foo:bar@arc:8000 but that didn't work.

Please let me know if it's possible to run it with Kibana ?

Add test cases for the users plugin

Test cases are missing for the following files in the users plugin:

  • handler functions - located in handlers.go
  • middleware functions - located in middleware.go

Open-source docker image availability

When using the example include docker-compose.yaml file, it builds the API server locally and is able to boot up. When using the dockerhub image available on https://hub.docker.com/r/appbaseio/reactivesearch-api, it fails to boot asking for a valid APPBASE_ID.

Could this be happening because of the build args not being opensource? https://github.com/appbaseio/reactivesearch-api/blob/dev/Dockerfile#L3-L18

My modified docker-compose file:

version: "3"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.2.0
    container_name: elasticsearch
    networks:
      - reactivesearch
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      nproc: 65536
      nofile:
        soft: 65536
        hard: 65536
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
  reactivesearch:
    #build: ./
    image: appbaseio/reactivesearch-api:8.20.3
    environment:
      - ES_CLUSTER_URL=http://elasticsearch:9200
    container_name: reactivesearch
    env_file:
      - config/docker.env
    networks:
      - reactivesearch
    restart: on-failure
    ports:
      - 8000:8000
    depends_on:
      - elasticsearch

networks:
  reactivesearch:
    driver: bridge
sarah@remote-dev:~/reactivesearch-api$ docker compose up reactivesearch
[+] Running 1/1
 ✔ reactivesearch Pulled                                                                                       0.9s 
[+] Running 2/0
 ✔ Container elasticsearch   Running                                                                           0.0s 
 ✔ Container reactivesearch  Recreated                                                                         0.1s 
Attaching to reactivesearch
reactivesearch  | => port used 8000
reactivesearch  | [cmd] : reading env file .env . This may happen if the environments are declared directly :  open .env: no such file or directory
reactivesearch  | time="2024/01/09 19:08:35" level=fatal msg="APPBASE_ID env required but not present" file=" billing.go:615"
reactivesearch exited with code 0

What version of ReactiveSearch API are you using ?

latest

What issue did you run into?

What did you expect to see?

What did you see instead?

problem when using arc

  1. github.com/appbaseio-confidential or github.com/appbaseio ?
  2. seems arc only validate the username. password can be anything
  3. password should be encrypted stored. (maybe bcrypt)

Make sure all the existing test cases are working as expected

How to reproduce?

Run go test ./... at the root in feat/es7 branch

You can easily see that a lot of test cases get failed, we need to fix it and make sure that all the test cases work as expected.

Additional Context

We recently upgraded the elastic search version from 6.x to 7.x which has some breaking changes, probably that might be the reason for some failed test cases.

Internal Server Error when posting a permission while being authenticated with another permission

What version of ReactiveSearch API are you using ?

8.9.0

What issue did you run into?

  1. Create a permission (API Credentials) with a read-write access to the "permissions" category.
  2. Use the credentials of the just created permission in HTTP Basic Auth to send a POST /_permission request, trying to create another permission object.

What did you expect to see?

A created permission.

What did you see instead?

Internal server error saying "*user.User" not found in request context.

From what I was able to find in the code as a non-Go developer, looks like the user is being read from the context right here for the only purpose to check if it's admin or not, which decides the permission's default settings. And if the user not found, the error is being thrown.
Looking at the auth middleware I can see it being assigned only when the request is authenticated on behalf of a user. When you use API Credentials to authenticate the request, the permission is being assigned to the context instead.
I haven't found anywhere in the documentation that you can only create permissions when authenticated as a user. So I think it's a bug.
Would it be possible to fix it by assuming the user is not an admin if the request is authenticated with the API Credentials?

Failed to compile on ubuntu 20 with golang 1.17.7

Failed to compile manually

/opt/apps/reactivesearch-api$ make
go build --buildmode=plugin -o build/plugins/auth.so plugins/auth/main/auth.go

github.com/cespare/xxhash

asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/cespare/[email protected]/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed

github.com/cespare/xxhash/v2

asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/cespare/xxhash/[email protected]/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed

github.com/klauspost/compress/zstd/internal/xxhash

asm: xxhash_amd64.s:120: when dynamic linking, R15 is clobbered by a global variable access and is used here: 00092 (/home/tomburnell/go/pkg/mod/github.com/klauspost/[email protected]/zstd/internal/xxhash/xxhash_amd64.s:120) ADDQ R15, AX
asm: assembly failed
make: *** [Makefile:20: plugins/auth/main/auth.so] Error 2

What version of ReactiveSearch API are you using ?

commit hash: 8da3f17

ubuntu 20

go version
go version go1.17.7 linux/amd64

$ uname -a
Linux artcore-vb 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

i$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu120.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1
20.04)

License key and docker installation open source

What version of ReactiveSearch API are you using ?

Latest version

What issue did you run into?

Started project up with docker compose, getting error

msg="[cmd] Unable to read license file open --log: no such file or directory" file=" entry.go:359"

What did you expect to see?

Expected reactive search api to start up

What did you see instead?

error:

msg="[cmd] Unable to read license file open --log: no such file or directory" file=" entry.go:359"

There seems to be something missing steps in the docker setup. Where do I get my license key and where do I put it in the docker compose / env file ?

Add test cases for the elasticsearch plugin

Currently, we don't have test cases for the elasticsearch plugin, we should add test cases for the following files.

  • handlers functions - located in handlers.go
  • routes functions - located in routes.go
  • middleware functions - located in middleware.go

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.