Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3-support using protobuf-3.0.0a2 #44

Merged
merged 2 commits into from
May 29, 2015
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
1 change: 1 addition & 0 deletions chromecast_protobuf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These files were imported from https://chromium.googlesource.com/chromium/src.git/+/master/extensions/common/api/cast_channel to generate the \_pb2.py-files.
13 changes: 13 additions & 0 deletions chromecast_protobuf/authority_keys.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package extensions.core_api.cast_channel.proto;
message AuthorityKeys {
message Key {
required bytes fingerprint = 1;
required bytes public_key = 2;
}
repeated Key keys = 1;
}
77 changes: 77 additions & 0 deletions chromecast_protobuf/cast_channel.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package extensions.core_api.cast_channel;
message CastMessage {
// Always pass a version of the protocol for future compatibility
// requirements.
enum ProtocolVersion {
CASTV2_1_0 = 0;
}
required ProtocolVersion protocol_version = 1;
// source and destination ids identify the origin and destination of the
// message. They are used to route messages between endpoints that share a
// device-to-device channel.
//
// For messages between applications:
// - The sender application id is a unique identifier generated on behalf of
// the sender application.
// - The receiver id is always the the session id for the application.
//
// For messages to or from the sender or receiver platform, the special ids
// 'sender-0' and 'receiver-0' can be used.
//
// For messages intended for all endpoints using a given channel, the
// wildcard destination_id '*' can be used.
required string source_id = 2;
required string destination_id = 3;
// This is the core multiplexing key. All messages are sent on a namespace
// and endpoints sharing a channel listen on one or more namespaces. The
// namespace defines the protocol and semantics of the message.
required string namespace = 4;
// Encoding and payload info follows.
// What type of data do we have in this message.
enum PayloadType {
STRING = 0;
BINARY = 1;
}
required PayloadType payload_type = 5;
// Depending on payload_type, exactly one of the following optional fields
// will always be set.
optional string payload_utf8 = 6;
optional bytes payload_binary = 7;
}
enum SignatureAlgorithm {
UNSPECIFIED = 0;
RSASSA_PKCS1v15 = 1;
RSASSA_PSS = 2;
}
// Messages for authentication protocol between a sender and a receiver.
message AuthChallenge {
optional SignatureAlgorithm signature_algorithm = 1
[default = RSASSA_PKCS1v15];
}
message AuthResponse {
required bytes signature = 1;
required bytes client_auth_certificate = 2;
repeated bytes intermediate_certificate = 3;
optional SignatureAlgorithm signature_algorithm = 4
[default = RSASSA_PKCS1v15];
}
message AuthError {
enum ErrorType {
INTERNAL_ERROR = 0;
NO_TLS = 1; // The underlying connection is not TLS
SIGNATURE_ALGORITHM_UNAVAILABLE = 2;
}
required ErrorType error_type = 1;
}
message DeviceAuthMessage {
// Request fields
optional AuthChallenge challenge = 1;
// Response fields
optional AuthResponse response = 2;
optional AuthError error = 3;
}
134 changes: 134 additions & 0 deletions chromecast_protobuf/logging.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package extensions.core_api.cast_channel.proto;
enum EventType {
EVENT_TYPE_UNKNOWN = 0;
CAST_SOCKET_CREATED = 1;
READY_STATE_CHANGED = 2;
CONNECTION_STATE_CHANGED = 3;
READ_STATE_CHANGED = 4;
WRITE_STATE_CHANGED = 5;
ERROR_STATE_CHANGED = 6;
CONNECT_FAILED = 7;
TCP_SOCKET_CONNECT = 8; // Logged with RV.
TCP_SOCKET_SET_KEEP_ALIVE = 9;
SSL_CERT_WHITELISTED = 10;
SSL_SOCKET_CONNECT = 11; // Logged with RV.
SSL_INFO_OBTAINED = 12;
DER_ENCODED_CERT_OBTAIN = 13; // Logged with RV.
RECEIVED_CHALLENGE_REPLY = 14;
AUTH_CHALLENGE_REPLY = 15;
CONNECT_TIMED_OUT = 16;
SEND_MESSAGE_FAILED = 17;
MESSAGE_ENQUEUED = 18; // Message
SOCKET_WRITE = 19; // Logged with RV.
MESSAGE_WRITTEN = 20; // Message
SOCKET_READ = 21; // Logged with RV.
MESSAGE_READ = 22; // Message
SOCKET_CLOSED = 25;
SSL_CERT_EXCESSIVE_LIFETIME = 26;
CHANNEL_POLICY_ENFORCED = 27;
TCP_SOCKET_CONNECT_COMPLETE = 28; // Logged with RV.
SSL_SOCKET_CONNECT_COMPLETE = 29; // Logged with RV.
SSL_SOCKET_CONNECT_FAILED = 30; // Logged with RV.
SEND_AUTH_CHALLENGE_FAILED = 31; // Logged with RV.
AUTH_CHALLENGE_REPLY_INVALID = 32;
PING_WRITE_ERROR = 33; // Logged with RV.
}
enum ChannelAuth {
// SSL over TCP.
SSL = 1;
// SSL over TCP with challenge and receiver signature verification.
SSL_VERIFIED = 2;
}
enum ReadyState {
READY_STATE_NONE = 1;
READY_STATE_CONNECTING = 2;
READY_STATE_OPEN = 3;
READY_STATE_CLOSING = 4;
READY_STATE_CLOSED = 5;
}
enum ConnectionState {
CONN_STATE_NONE = 1;
CONN_STATE_TCP_CONNECT = 2;
CONN_STATE_TCP_CONNECT_COMPLETE = 3;
CONN_STATE_SSL_CONNECT = 4;
CONN_STATE_SSL_CONNECT_COMPLETE = 5;
CONN_STATE_AUTH_CHALLENGE_SEND = 6;
CONN_STATE_AUTH_CHALLENGE_SEND_COMPLETE = 7;
CONN_STATE_AUTH_CHALLENGE_REPLY_COMPLETE = 8;
}
enum ReadState {
READ_STATE_NONE = 1;
READ_STATE_READ = 2;
READ_STATE_READ_COMPLETE = 3;
READ_STATE_DO_CALLBACK = 4;
READ_STATE_ERROR = 5;
}
enum WriteState {
WRITE_STATE_NONE = 1;
WRITE_STATE_WRITE = 2;
WRITE_STATE_WRITE_COMPLETE = 3;
WRITE_STATE_DO_CALLBACK = 4;
WRITE_STATE_ERROR = 5;
}
enum ErrorState {
CHANNEL_ERROR_NONE = 1;
CHANNEL_ERROR_CHANNEL_NOT_OPEN = 2;
CHANNEL_ERROR_AUTHENTICATION_ERROR = 3;
CHANNEL_ERROR_CONNECT_ERROR = 4;
CHANNEL_ERROR_SOCKET_ERROR = 5;
CHANNEL_ERROR_TRANSPORT_ERROR = 6;
CHANNEL_ERROR_INVALID_MESSAGE = 7;
CHANNEL_ERROR_INVALID_CHANNEL_ID = 8;
CHANNEL_ERROR_CONNECT_TIMEOUT = 9;
CHANNEL_ERROR_UNKNOWN = 10;
}
enum ChallengeReplyErrorType {
CHALLENGE_REPLY_ERROR_NONE = 1;
CHALLENGE_REPLY_ERROR_PEER_CERT_EMPTY = 2;
CHALLENGE_REPLY_ERROR_WRONG_PAYLOAD_TYPE = 3;
CHALLENGE_REPLY_ERROR_NO_PAYLOAD = 4;
CHALLENGE_REPLY_ERROR_PAYLOAD_PARSING_FAILED = 5;
CHALLENGE_REPLY_ERROR_MESSAGE_ERROR = 6;
CHALLENGE_REPLY_ERROR_NO_RESPONSE = 7;
CHALLENGE_REPLY_ERROR_FINGERPRINT_NOT_FOUND = 8;
CHALLENGE_REPLY_ERROR_CERT_PARSING_FAILED = 9;
CHALLENGE_REPLY_ERROR_CERT_NOT_SIGNED_BY_TRUSTED_CA = 10;
CHALLENGE_REPLY_ERROR_CANNOT_EXTRACT_PUBLIC_KEY = 11;
CHALLENGE_REPLY_ERROR_SIGNED_BLOBS_MISMATCH = 12;
}
message SocketEvent {
// Required
optional EventType type = 1;
optional int64 timestamp_micros = 2;
optional string details = 3;
optional int32 net_return_value = 4;
optional string message_namespace = 5;
optional ReadyState ready_state = 6;
optional ConnectionState connection_state = 7;
optional ReadState read_state = 8;
optional WriteState write_state = 9;
optional ErrorState error_state = 10;
optional ChallengeReplyErrorType challenge_reply_error_type = 11;
optional int32 nss_error_code = 12;
}
message AggregatedSocketEvent {
optional int32 id = 1;
optional int32 endpoint_id = 2;
optional ChannelAuth channel_auth_type = 3;
repeated SocketEvent socket_event = 4;
optional int64 bytes_read = 5;
optional int64 bytes_written = 6;
}
message Log {
// Each AggregatedSocketEvent represents events recorded for a socket.
repeated AggregatedSocketEvent aggregated_socket_event = 1;
// Number of socket log entries evicted by the logger due to size constraints.
optional int32 num_evicted_aggregated_socket_events = 2;
// Number of event log entries evicted by the logger due to size constraints.
optional int32 num_evicted_socket_events = 3;
}
118 changes: 118 additions & 0 deletions pychromecast/authority_keys_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading