File: service.proto

package info (click to toggle)
golang-github-humanlogio-api 0.0~git20250305.fa41d14-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,352 kB
  • sloc: sh: 45; makefile: 8
file content (65 lines) | stat: -rw-r--r-- 1,730 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
syntax = "proto3";

package svc.auth.v1;

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "types/v1/environment.proto";
import "types/v1/meta.proto";
import "types/v1/user_token.proto";
import "types/v1/version.proto";

option go_package = "svc/auth/v1;authv1";

service AuthService {
  rpc GetAuthURL(GetAuthURLRequest) returns (GetAuthURLResponse) {}
  rpc BeginDeviceAuth(BeginDeviceAuthRequest) returns (BeginDeviceAuthResponse) {}
  rpc CompleteDeviceAuth(CompleteDeviceAuthRequest) returns (CompleteDeviceAuthResponse) {}
}

message GetAuthURLRequest {
  // optional: if an org is specified
  oneof organization {
    int64 by_id = 100;
    string by_name = 101;
  }
  string return_to_url = 2;
  LocalhostViaBrowser localhost = 3;
}

message LocalhostViaBrowser {
  string architecture = 1;
  string operating_system = 2;
  types.v1.Version using_version = 3;
}

message GetAuthURLResponse {
  string auth_url = 1;
}

message BeginDeviceAuthRequest {
  string organization = 1;
  string return_to_url = 2;
}

message BeginDeviceAuthResponse {
  string url = 1;
  // device_code must be used to retrieve an authenticated user token with `CompleteDeviceAuth`
  string device_code = 2;
  string user_code = 3;
  google.protobuf.Timestamp expires_at = 4;
  google.protobuf.Duration poll_interval = 5;
}

message CompleteDeviceAuthRequest {
  // device_code is returned when calling `BeginDeviceAuth` and allows an auth flow
  // to retrieve the user token that is generated when a user is authenticated
  string device_code = 1;
  string user_code = 2;
  string architecture = 5;
  string operating_system = 6;
}

message CompleteDeviceAuthResponse {
  types.v1.UserToken token = 1;
}