Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions protobuf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,30 @@ From within the Azure Functions language worker repo:
1. Define remote branch for cleaner git commands
- `git remote add proto-file https://github.com/azure/azure-functions-language-worker-protobuf.git`
- `git fetch proto-file`
2. Merge updates
- `git merge -s subtree proto-file/<version branch> --squash --allow-unrelated-histories`
- You can also merge with an explicit path to subtree: `git merge -X subtree=<path in language worker repo> --squash proto-file/<version branch> --allow-unrelated-histories`
3. Finalize with commit
- `git commit -m "Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Branch: <version branch>. Commit: <latest protobuf commit hash>"`
2. Pull a specific release tag
- `git fetch proto-file refs/tags/<tag-name>`
- Example: `git fetch proto-file refs/tags/v1.1.0-protofile`
3. Merge updates
- Merge with an explicit path to subtree: `git merge -X subtree=<path in language worker repo> --squash <tag-name> --allow-unrelated-histories`
- Example: `git merge -X subtree=src/WebJobs.Script.Grpc/azure-functions-language-worker-protobuf --squash v1.1.0-protofile --allow-unrelated-histories`
4. Finalize with commit
- `git commit -m "Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: <tag-name>. Commit: <commit hash>"`
- `git push`


## Releasing a Language Worker Protobuf version

1. Draft a release in the GitHub UI
- Be sure to inculde details of the release
2. Create a release version, following semantic versioning guidelines ([semver.org](https://semver.org/))
3. Tag the version with the pattern: `v<M>.<m>.<p>-protofile` (example: `v1.1.0-protofile`)
3. Merge `dev` to `master`

## Consuming FunctionRPC.proto
*Note: Update versionNumber before running following commands*

## CSharp
```
set NUGET_PATH=%UserProfile%\.nuget\packages
set NUGET_PATH="%UserProfile%\.nuget\packages"
set GRPC_TOOLS_PATH=%NUGET_PATH%\grpc.tools\<versionNumber>\tools\windows_x86
set PROTO_PATH=.\azure-functions-language-worker-protobuf\src\proto
set PROTO=.\azure-functions-language-worker-protobuf\src\proto\FunctionRpc.proto
Expand Down
43 changes: 43 additions & 0 deletions protobuf/src/proto/FunctionRpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package AzureFunctionsRpcMessages;

import "google/protobuf/duration.proto";
import "identity/ClaimsIdentityRpc.proto";
import "shared/NullableTypes.proto";

// Interface exported by the server.
service FunctionRpc {
Expand Down Expand Up @@ -236,6 +237,9 @@ message RpcFunctionMetadata {

// Bindings info
map<string, BindingInfo> bindings = 6;

// Is set to true for proxy
bool is_proxy = 7;
}

// Host requests worker to invoke a Function
Expand Down Expand Up @@ -375,6 +379,44 @@ message RpcException {
string message = 2;
}

// Http cookie type. Note that only name and value are used for Http requests
message RpcHttpCookie {
// Enum that lets servers require that a cookie shouoldn't be sent with cross-site requests
enum SameSite {
None = 0;
Lax = 1;
Strict = 2;
}

// Cookie name
string name = 1;

// Cookie value
string value = 2;

// Specifies allowed hosts to receive the cookie
NullableString domain = 3;

// Specifies URL path that must exist in the requested URL
NullableString path = 4;

// Sets the cookie to expire at a specific date instead of when the client closes.
// It is generally recommended that you use "Max-Age" over "Expires".
NullableTimestamp expires = 5;

// Sets the cookie to only be sent with an encrypted request
NullableBool secure = 6;

// Sets the cookie to be inaccessible to JavaScript's Document.cookie API
NullableBool http_only = 7;

// Allows servers to assert that a cookie ought not to be sent along with cross-site requests
SameSite same_site = 8;

// Number of seconds until the cookie expires. A zero or negative number will expire the cookie immediately.
NullableDouble max_age = 9;
}

// TODO - solidify this or remove it
message RpcHttp {
string method = 1;
Expand All @@ -387,4 +429,5 @@ message RpcHttp {
bool enable_content_negotiation= 16;
TypedData rawBody = 17;
repeated RpcClaimsIdentity identities = 18;
repeated RpcHttpCookie cookies = 19;
}
2 changes: 1 addition & 1 deletion protobuf/src/proto/identity/ClaimsIdentityRpc.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syntax = "proto3";
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3

import "shared/NullableString.proto";
import "shared/NullableTypes.proto";

// Light-weight representation of a .NET System.Security.Claims.ClaimsIdentity object.
// This is the same serialization as found in EasyAuth, and needs to be kept in sync with
Expand Down
8 changes: 0 additions & 8 deletions protobuf/src/proto/shared/NullableString.proto

This file was deleted.

28 changes: 28 additions & 0 deletions protobuf/src/proto/shared/NullableTypes.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";
// protobuf vscode extension: https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3

import "google/protobuf/timestamp.proto";

message NullableString {
oneof string {
string value = 1;
}
}

message NullableDouble {
oneof double {
double value = 1;
}
}

message NullableBool {
oneof bool {
bool value = 1;
}
}

message NullableTimestamp {
oneof timestamp {
google.protobuf.Timestamp value = 1;
}
}