diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b86f8c0..bde753b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,8 +31,8 @@ jobs: - name: Build run: npm run build - - name: Generate TS Protobuf - run: npm run generate + - name: Generate Protobuf + run: protoc -I ./proto ./proto/*.proto \ --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit \ --go_out=./gen --go_opt=paths=source_relative \ --go-grpc_out=./gen --go-grpc_opt=paths=source_relative - name: Publish package run: npm publish diff --git a/package.json b/package.json index 788c977..5c39df8 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "@lendry-erp/contracts", - "version": "1.0.8", + "version": "1.0.9", "description": "Protobuf definitions and generated TypeScript types", "type": "commonjs", "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { - "build": "tsc -p tsconfig.build.json", - "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit" + "build": "tsc -p tsconfig.build.json" }, "files": [ "dist", diff --git a/proto/ldap.proto b/proto/ldap.proto new file mode 100644 index 0000000..65e82a0 --- /dev/null +++ b/proto/ldap.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package ldap_service; +import "google/rpc/status.proto"; + +service LdapAuth { + rpc VerifyUser (VerifyRequest) returns (VerifyResponse); +} + +message VerifyRequest { + string username = 1; + string password = 2; +} + +message VerifyResponse { + bool success = 1; + string error_message = 2; + UserData user = 3; +} + +message UserData { + string dn = 1; + string display_name = 2; + repeated string groups = 3; + bool is_active = 4; +} + diff --git a/src/proto/paths.ts b/src/proto/paths.ts index f2bfb83..1e5a4be 100644 --- a/src/proto/paths.ts +++ b/src/proto/paths.ts @@ -2,4 +2,5 @@ import { join } from "path"; export const PROTO_PATHS = { AUTH: join(__dirname, "../../proto/identity.proto"), + LDAP: join(__dirname, "../../proto/ldap.proto"), } as const;