Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Commit

Permalink
feat: Open ID. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Aug 30, 2023
1 parent d5aa2e0 commit 07ca6eb
Show file tree
Hide file tree
Showing 5 changed files with 891 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adempiere/grpc-api",
"version": "4.9.8",
"version": "4.9.9",
"description": "ADempiere Web write in Javascript for a node service",
"author": "Yamel Senih",
"contributors": [
Expand Down
25 changes: 25 additions & 0 deletions proto/security.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ service Security {
rpc SetSessionAttribute(SetSessionAttributeRequest) returns (Session) {}
// List Roles
rpc ListRoles(ListRolesRequest) returns (ListRolesResponse) {}
// List Available Services
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {}
// Request login from Open ID
rpc RunLoginOpenID(LoginOpenIDRequest) returns (Session) {}
}


Expand Down Expand Up @@ -203,3 +207,24 @@ message Menu {
repeated Menu childs = 13;
bool is_active = 14;
}

// Open ID
message ListServicesRequest {
}

message ListServicesResponse {
repeated Service services = 1;
}

message Service {
int32 id = 1;
string display_name = 2;
string authorization_uri = 3;
}

message LoginOpenIDRequest {
string code_parameter = 1;
string state_parameter = 2;
string language = 3;
string client_version = 4;
}
57 changes: 57 additions & 0 deletions src/grpc/proto/security_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@ function deserialize_security_ListRolesResponse(buffer_arg) {
return proto_security_pb.ListRolesResponse.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_security_ListServicesRequest(arg) {
if (!(arg instanceof proto_security_pb.ListServicesRequest)) {
throw new Error('Expected argument of type security.ListServicesRequest');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_security_ListServicesRequest(buffer_arg) {
return proto_security_pb.ListServicesRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_security_ListServicesResponse(arg) {
if (!(arg instanceof proto_security_pb.ListServicesResponse)) {
throw new Error('Expected argument of type security.ListServicesResponse');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_security_ListServicesResponse(buffer_arg) {
return proto_security_pb.ListServicesResponse.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_security_LoginOpenIDRequest(arg) {
if (!(arg instanceof proto_security_pb.LoginOpenIDRequest)) {
throw new Error('Expected argument of type security.LoginOpenIDRequest');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_security_LoginOpenIDRequest(buffer_arg) {
return proto_security_pb.LoginOpenIDRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_security_LoginRequest(arg) {
if (!(arg instanceof proto_security_pb.LoginRequest)) {
throw new Error('Expected argument of type security.LoginRequest');
Expand Down Expand Up @@ -260,6 +293,30 @@ listRoles: {
responseSerialize: serialize_security_ListRolesResponse,
responseDeserialize: deserialize_security_ListRolesResponse,
},
// List Available Services
listServices: {
path: '/security.Security/ListServices',
requestStream: false,
responseStream: false,
requestType: proto_security_pb.ListServicesRequest,
responseType: proto_security_pb.ListServicesResponse,
requestSerialize: serialize_security_ListServicesRequest,
requestDeserialize: deserialize_security_ListServicesRequest,
responseSerialize: serialize_security_ListServicesResponse,
responseDeserialize: deserialize_security_ListServicesResponse,
},
// Request login from Open ID
runLoginOpenID: {
path: '/security.Security/RunLoginOpenID',
requestStream: false,
responseStream: false,
requestType: proto_security_pb.LoginOpenIDRequest,
responseType: proto_security_pb.Session,
requestSerialize: serialize_security_LoginOpenIDRequest,
requestDeserialize: deserialize_security_LoginOpenIDRequest,
responseSerialize: serialize_security_Session,
responseDeserialize: deserialize_security_Session,
},
};

exports.SecurityClient = grpc.makeGenericClientConstructor(SecurityService);
Loading

0 comments on commit 07ca6eb

Please sign in to comment.