Skip to content

Instantly share code, notes, and snippets.

View abstractj's full-sized avatar

Bruno Oliveira da Silva abstractj

View GitHub Profile
# is the url for retrieve the openid configuration - normally the <server>/auth/realm/<realm_name>
discovery-url: http://localhost:8180/auth/realms/summit
# the client id for the 'client' application
client-id: go-rest
# the interface definition you wish the proxy to listen, all interfaces is specified as ':<port>'
listen: 127.0.0.1:4000
# log all incoming requests
enable-logging: true
# log in json format
@abstractj
abstractj / gist:d7e1ca70519184ed1e8701be6729ebbf
Created June 21, 2017 22:59 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@abstractj
abstractj / tuto.md
Last active October 13, 2015 13:58 — forked from sebastienblanc/tuto.md

#tuto

Intro

Web applications

  • In the past
    • Java applets
    • Servlets
    • Limited connectivity
  • Static pages
var crypto = require('crypto');
var cipher = crypto.createCipher( process.argv[2], 'tacos' );
//aes-gcm 256
//key size must be 32
var cipher = crypto.createCipheriv('aes-256-gcm', '3zTvzr3p67VC61jmV54rIYu1545x4TlY', 'X6sIq117H0vR');
var cipher = crypto.createCipher('aes-256-gcm', '3zTvzr3p67VC61jmV54rIYu1545x4TlY');
//aes-gcm 128

User Management for the Aerogear Unfied Push Server

Introduction

The goal of this document is to describe how the User Management will be implemented in the Unified Push Server. Currently there is only one user created by default when installing UPS. Having the possibility to create multiple users is a "Must Have" and should be manageable from the Admin Console. Some roles should also be introduced

Roles / Permissions

if (!this.identity.isLoggedIn()) {
this.credentials.setUserId(saleAgent.getLoginName());
this.credentials.setPassword(saleAgent.getPassword());
this.identity.login();
} else {
throw new RuntimeException("Authentication failed");
}
@abstractj
abstractj / shot.js
Created July 25, 2013 20:07 — forked from ahomu/shot.js
console.log('Loading a web page');
var page = require('webpage').create();
var url = 'http://localhost:1947/';
page.viewportSize = {
width: 1024,
height: 768
};
page.open(url, function (status) {
//Page is loaded!
var iz, i = 0, queue = {};
  1. Deploy aerogear-controller-demo
  2. Try ios-otp-demo to login and validate otp
  3. Log in to aerogear-controller-demo with user 'john'
  4. Use the restricted admin page to register a new user
  5. Delete the newly created user
  6. Try the iso-otp-demo once again. For me the error below will be displayed in the servers console
11:00:24,761 INFO  [stdout] (http--127.0.0.1-8080-3) [Demo Error handler :null
11:00:24,788 ERROR [org.jboss.ejb3.invocation] (http--127.0.0.1-8080-3) JBAS014134: EJB Invocation failed on component Otp for method public org.jboss.aerogear.security.model.AeroGearUser org.jboss.aerogear.controller.demo.Otp.secret(): javax.ejb.EJBException: java.lang.NullPointerException

This is my route :

route().from("/customers/{id}")
.on(RequestMethod.GET)
.consumes(JSON).produces(JSON)
.to(CustomerEndpoint.class)
.findById(param("id");

This the method of my endpoint :

Pagination RESTFul API on AeroGear Controller

This document describes pagination in AeroGear. It defines the metadata passed between the client and server.

Parameters

  • offset
    The offset of the first element that should be included in the returned collection. Default value is 0.
  • limit
    The number of elements that should be returned. Default value is 10
  • total
    The total number of elements available.