Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    kalyan kuramana
    @kalyanbabu_iit_twitter
    *yoy
    *you
    Jonathan Stoikovitch
    @jstoiko
    I will
    kalyan kuramana
    @kalyanbabu_iit_twitter
    cool
    christopheblin
    @christopheblin
    hi all
    I'd like to start using ramses on mac os but after creating the virtualenv described in the getting started I have an error that I do not understand, can someone help ?
    christopheblin
    @christopheblin
    never mind, I've solved my error
    now I'd like to know how can I regenerate my postgres db when I change a schema ?
    Jonathan Stoikovitch
    @jstoiko
    you can drop your DB and DELETE your elasticsearch index. Ramses will recreate this for you, using the new schema to create the table schema in Postgres and the mappings in ES.
    James Healy
    @StoicNZ_twitter
    Hey all, any plans to support RAML 1.0?
    Jonathan Stoikovitch
    @jstoiko
    for sure! this is highly dependent on the underlying parser, Ramlfications, and you can follow the progress here: https://github.com/spotify/ramlfications/wiki/RAMLfications-v0.2.0-Release
    James Healy
    @StoicNZ_twitter
    Ah, didn't realise Spotify works with RAML. Very cool.
    bigmodem
    @bigmodem
    I want to add ramses to my exist pyramid based web site, how can i change local.ini that I get a '/api/' for ramses views and '/' for other pyramid routes?
    bigmodem
    @bigmodem
    When will ramses support JSONB column type from PostgreSQL 9.5 ? I want to use incremental update for a dict field in a PUT method.
    kalyankuramana
    @kalyankuramana
    why is the indexing of value of fields of type dict is disabled by default, how to query for fields inside a dict object
    should i use regex or enable it
    Charlene Gilbert
    @gilbcharlene
    I am trying to run the example from: https://www.elastic.co/blog/make-an-elasticsearch-powered-rest-api-for-any-data-with-ramses. Can I use mongodb instead of postgresql? I selected mongodb and tried to start the server but I get the following message " The 'gii_api' distribution was not found and is required by the application"
    kalyankuramana
    @kalyankuramana
    could you post the trace of error
    Jonathan Stoikovitch
    @jstoiko
    @gilbcharlene looks like your scaffolded app 'gii_api' is not installed. can you copy/paste the output of pip freeze from within your environment?
    Charlene Gilbert
    @gilbcharlene
    I'm getting this error: ValueError: User: Model AuthProvider used in relationship auth_provider is not defined. I do have an auth_provider.json file with a schema but it's not defined in api.raml because I don't want it as an endpoint people can access
    Charlene Gilbert
    @gilbcharlene
    I found this issue and the workaround solved my issue: ramses-tech/ramses#88
    Charlene Gilbert
    @gilbcharlene

    I'm trying to add a nested relationship to a model and I receive this error when running the server: Exception: TransportError(400, u'illegal_argument_exception', u'mapper [authproviders] of different type, current_type [string], merged_type [ObjectMapper]')

    user.json: http://pastebin.com/kMMbDQJJ
    authproviders.json: http://pastebin.com/0LXHY2UQ

    Charlene Gilbert
    @gilbcharlene
    Is it possible to have a list with an item_type of "object"?
    kalyankuramana
    @kalyankuramana
    @jstoiko How do i use celery with ramses , i am finding it hard to fetch model objects . i would appreciate any insights . thanks
    kalyankuramana
    @kalyankuramana
    never mind , using pyramid_celery solved the problem
    thans
    thanks
    Bachir El Khoury
    @bachirelkhoury
    Hi all, looking at ramses as an alternative backend and API to move away from nodejs and Loopback. yup we're done dealing with nodejs. I'm a big fan of pyramid and was checking out ramses-example https://github.com/ramses-tech/ramses-example
    all good, only stuck one thing, the ramses_auth_tkt that I get from login
    currently returning 3 headers, but can't seem to get the right header setup on the client.
    Bachir El Khoury
    @bachirelkhoury
      "headers": [
        [
          "Set-Cookie",
          "ramses_auth_tkt=118c288d70246a38e4a9ab4df07accce37368eb2d73e6b8fe8eaf84b1e0aee7e8b3bb07df78d0882a59baaf712e2f71249ac42802d867e60f97fca9be0dc21c857f743a6Zm9vYmFy!userid_type:b64unicode; Path=/; HttpOnly"
        ],
    what should the header be set to? this doesn't seem to be correct and tried most combinations I can think of
    Authorization=118c288d70246a38e4a9ab4df07accce37368eb2d73e6b8fe8eaf84b1e0aee7e8b3bb07df78d0882a59baaf712e2f71249ac42802d867e60f97fca9be0dc21c857f743a6Zm9vYmFy
    Bachir El Khoury
    @bachirelkhoury
    is that similar to JWT implementation? https://jwt.io/
    kalyankuramana
    @kalyankuramana
    Authorization: ApiKey username:token
    kalyankuramana
    @kalyankuramana
    thats the format when apitoken policy is used
    kalyankuramana
    @kalyankuramana
    if one uses ticket policy , then the key should be sent over a cookie with cookie name as auth_tkt
    for more information look in pyramid.authentication.AuthTktAuthenticationPolicy
    and observe pyramid.authentication.AuthTktCookieHelper.identify()
    Bachir El Khoury
    @bachirelkhoury

    thanks @kalyankuramana I have setup to use x_token_auth:

    securedBy: [x_token_auth]

    The issue I'm getting is that x_token_auth requires settings as per this comment:
    https://github.com/ramses-tech/ramses/issues/97#issuecomment-160353919

    ...
        - x_token_auth:
            description: Authorization header token policy
            type: x-ApiKey
            settings:
                foo: bar
    ...

    if I run this I get this error which is fair enough, I'm not sure what parameters this accepts. Can't find references in the docs.

      File "~/.virtualenvs/myenv/lib/python2.7/site-packages/ramses/auth.py", line 133, in _setup_apikey_policy
        policy = ApiKeyAuthenticationPolicy(**params)
    TypeError: __init__() got an unexpected keyword argument 'foo'
    kalyankuramana
    @kalyankuramana
    no need to provide settings parameter , it is required if you want to use custom model for auth and have not specified in custom schema ("_auth_model":true) then
    kalyankuramana
    @kalyankuramana
    ...
    settings:
    user_model: <schema name>
    check: <a callback to return none if user does not exist or principal identifier if user exists: format check(username,apikey,request)> (optional)
    credentials_callback: < a callback to return token given username and request> format:(username,request) (optional)
    ...
    Bachir El Khoury
    @bachirelkhoury
    @kalyankuramana thanks I will check it out. Not many examples out there about that which seems strange given it looks like a great API framework.
    Bachir El Khoury
    @bachirelkhoury

    Using x_token_auth seems to register ok and return the token, only this setting doesn't generate the login, logout views. Maybe I'm missing something, or am I support to implement login/logout myself?
    thanks

    securedBy: [x_token_auth]

    https://github.com/ramses-tech/ramses/blob/51b2094a2dca4cacd37f3ce2466e191b0045549f/ramses/auth.py#L155-L158

    x_ticket_auth does:

    securedBy: [x_ticket_auth]

    https://github.com/ramses-tech/ramses/blob/51b2094a2dca4cacd37f3ce2466e191b0045549f/ramses/auth.py#L97-L100

    Bachir El Khoury
    @bachirelkhoury
    Ok I see, I needed to POST /auth/token to login.
    all good then, thanks.
    POST http://localhost:6543/api/auth/token
    {"login":"someUser", "password":"password"}
    
    {
      "headers": [
        [
          "WWW-Authenticate",
          "ApiKey somUser:3ad6f8ab388d4be2b20a81b6c2fcc3dd"
        ]
      ],
      "timestamp": "2016-10-11T04:22:57Z",
      "title": "OK",
      "status_code": 200,
      "explanation": "",
      "message": "Token claimed"
    }
    Jonathan Stoikovitch
    @jstoiko

    disclaimer: token auth in nefertari and ramses should be considered alpha. it is not documented nor tested.

    feel free to try what's already in place, improve it and make a PR, we can include it in the next release.

    Bachir El Khoury
    @bachirelkhoury
    cool thanks @jstoiko
    Charlene Gilbert
    @gilbcharlene
    how do I configure elasticsearch.hosts if my elasticsearch has ssl enabled and credentials directly in the host url?
    I checked nefertari/elasticsearch.py and it looks like it's splitting the elasticsearch.hosts string with the ':' delimeter which is incorrect
    Charlene Gilbert
    @gilbcharlene
    This is what I have in local.ini
    elasticsearch.host = localhost
    elasticsearch.port = 2394
    #elasticsearch.hosts = localhost:2394
    elasticsearch.http_auth = user:secret
    elasticsearch.use_ssl = True
    elasticsearch.verify_certs = True
    Charlene Gilbert
    @gilbcharlene
    despite that I see that nefertari is making requests using the http protocol and not https
    Charlene Gilbert
    @gilbcharlene
    I made a post at stackoverflow with more information on the error: http://stackoverflow.com/questions/40073938/how-to-configure-elasticsearch-to-use-ssl-with-basic-auth