syntax = "proto3";

option go_package = "v1";

option java_package = "io.stackrox.proto.api.v1";

import "google/api/annotations.proto";
import "api/v1/common.proto";
import "api/v1/empty.proto";
import "storage/user.proto";

package v1;

// Next Tag: 2
message GetUsersResponse {
    repeated storage.User users = 1;
}

// UserAttributeTuple descript the auth:key:value tuple that decides group membership.
// Next Tag: 4
message UserAttributeTuple {
    string auth_provider_id = 1;
    string key = 2;
    string value = 3;
}

// Next Tag: 2
message GetUsersAttributesResponse {
    repeated UserAttributeTuple users_attributes = 1;
}

service UserService {

    rpc GetUsers (Empty) returns (GetUsersResponse) {
        option (google.api.http) = {
            get: "/v1/users"
        };
    }

    rpc GetUser (ResourceByID) returns (storage.User) {
        option (google.api.http) = {
            get: "/v1/users/{id}"
        };
    }

    rpc GetUsersAttributes (Empty) returns (GetUsersAttributesResponse) {
        option (google.api.http) = {
            get: "/v1/usersattributes"
        };
    }

}
