repositorysource API
Table of Contents
upsquad/repositorysource/v1/source.proto
Internal repository source protocol. Only the strict authenticated source listener may serve it; never mount on public Connect/Envoy/Caveman surfaces.
ExchangeRequest
ExchangeRequest is the typed request.
| Field | Type | Label | Description |
|---|---|---|---|
| subject_token | string | Knowledge-audience bearer; sensitive, never logged. |
ExchangeResponse
ExchangeResponse is the typed result.
| Field | Type | Label | Description |
|---|---|---|---|
| access_token | string | Short-lived source bearer; sensitive, never logged. | |
| expires_at | google.protobuf.Timestamp | Absolute UTC bearer expiration. | |
| token_type | string | Always Bearer, never a refresh token or caller-selected token type. |
FindPathsRequest
FindPathsRequest is the typed request.
| Field | Type | Label | Description |
|---|---|---|---|
| pin | PinSelector | Repository and pin comparison selectors. | |
| query | string | Literal, case-sensitive path substring; never code/content search. | |
| page_size | int32 | Maximum returned paths, at most 200. | |
| cursor | string | Opaque authenticated continuation selector. |
FindPathsResponse
FindPathsResponse is the typed result.
| Field | Type | Label | Description |
|---|---|---|---|
| observation | SourceObservation | Required pin and freshness evidence. | |
| paths | string | repeated | Sorted permitted regular-file paths; no file bodies. |
| manifest_complete | bool | Manifest complete. | |
| has_more | bool | True exactly when a continuation cursor is supplied. | |
| next_cursor | string | Opaque next-page selector, empty on final page. | |
| search_scope | string | Always paths_only, including when there are no matches. |
ListPathsRequest
ListPathsRequest is the typed request.
| Field | Type | Label | Description |
|---|---|---|---|
| pin | PinSelector | Repository and pin comparison selectors. | |
| prefix | string | Canonical relative path prefix. | |
| page_size | int32 | Maximum returned paths, at most 200. | |
| cursor | string | Opaque authenticated continuation selector. |
ListPathsResponse
ListPathsResponse is the typed result.
| Field | Type | Label | Description |
|---|---|---|---|
| observation | SourceObservation | Required pin and freshness evidence. | |
| paths | string | repeated | Sorted permitted regular-file paths; no file bodies. |
| manifest_complete | bool | Complete tree enumerated, not every file read or understood. | |
| has_more | bool | True exactly when a continuation cursor is supplied. | |
| next_cursor | string | Opaque next-page selector, empty on final page. |
PinSelector
PinSelector contains comparison selectors, never session/tenant authority.
| Field | Type | Label | Description |
|---|---|---|---|
| repo_id | string | Registry identity; never tenant authority. | |
| pin_id | string | Server-issued pin selector, scoped to the verified session. | |
| repin | bool | Explicitly replace the selected pin after live authorization. |
ReadFileRequest
ReadFileRequest is the typed request.
| Field | Type | Label | Description |
|---|---|---|---|
| pin | PinSelector | Repository and pin comparison selectors. | |
| path | string | Canonical relative file path. | |
| start_line | int32 | One-based inclusive first returned/requested line. | |
| end_line | int32 | One-based inclusive final returned/requested line. |
ReadFileResponse
ReadFileResponse is the typed result.
| Field | Type | Label | Description |
|---|---|---|---|
| observation | SourceObservation | Required pin and freshness evidence. | |
| path | string | Canonical relative file path. | |
| start_line | int32 | One-based inclusive first returned/requested line. | |
| end_line | int32 | One-based inclusive final returned/requested line. | |
| text | string | Bounded redacted UTF-8 source excerpt. | |
| redacted | bool | Whether any source line was replaced by a redaction marker. | |
| truncated | bool | Always false: oversize is refusal, not partial success. |
SourceErrorDetail
SourceErrorDetail is attached to a non-OK gRPC status. The server emits only the documented closed code/message pair, never provider/raw errors.
| Field | Type | Label | Description |
|---|---|---|---|
| code | string | Closed documented source refusal identifier. | |
| message | string | Safe fixed message for the identifier, never raw provider text. | |
| retry_after_seconds | uint32 | Safe bounded retry delay, zero when not applicable. | |
| correlation_id | string | Server-issued diagnostic UUID, never caller text. |
SourceObservation
SourceObservation is required on every successful result. CURRENT describes the last observation time, not a guarantee about the branch at delivery.
| Field | Type | Label | Description |
|---|---|---|---|
| repo_id | string | Registry identity; never tenant authority. | |
| pin_id | string | Server-issued pin selector, scoped to the verified session. | |
| commit_sha | string | Immutable pinned Git commit. | |
| credential_epoch | int64 | Connection credential revision used by this pin. | |
| binding_epoch | int64 | Repository binding revision used by this pin. | |
| grant_epoch | int64 | Explicit source grant revision. | |
| observed_at | google.protobuf.Timestamp | UTC time of the most recent freshness observation attempt. | |
| freshness | Freshness | Required observation state; unspecified is invalid. | |
| pin_changed | bool | True only for an explicit re-pin that changed commits. | |
| previous_commit_sha | string | Previous commit when pin_changed is true; empty otherwise. |
Freshness
Freshness describes the latest branch observation attempt.
| Name | Number | Description |
|---|---|---|
| FRESHNESS_UNSPECIFIED | 0 | Unspecified observation state. |
| FRESHNESS_CURRENT | 1 | Current observation state. |
| FRESHNESS_BEHIND | 2 | Behind observation state. |
| FRESHNESS_UNKNOWN | 3 | Unknown observation state. |
RepositorySourceIssuer
RepositorySourceIssuer exchanges only a verified Knowledge subject token.
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| Exchange | ExchangeRequest | ExchangeResponse | Exchange uses the authenticated internal source channel only. |
RepositorySourceService
RepositorySourceService derives authority exclusively from verified claims.
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| ListPaths | ListPathsRequest | ListPathsResponse | ListPaths uses the authenticated internal source channel only. |
| FindPaths | FindPathsRequest | FindPathsResponse | FindPaths uses the authenticated internal source channel only. |
| ReadFile | ReadFileRequest | ReadFileResponse | ReadFile uses the authenticated internal source channel only. |
Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
|---|---|---|---|---|---|---|---|---|
| double | double | double | float | float64 | double | float | Float | |
| float | float | float | float | float32 | float | float | Float | |
| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| bool | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | |
| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |