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
18 changes: 14 additions & 4 deletions app/cli/internal/action/apitoken_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ type APITokenItem struct {
Name string `json:"name"`
Description string `json:"description"`
// JWT is returned only during the creation
JWT string `json:"jwt,omitempty"`
CreatedAt *time.Time `json:"createdAt"`
RevokedAt *time.Time `json:"revokedAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
JWT string `json:"jwt,omitempty"`
CreatedAt *time.Time `json:"createdAt"`
RevokedAt *time.Time `json:"revokedAt,omitempty"`
ExpiresAt *time.Time `json:"expiresAt,omitempty"`
ProjectID string `json:"projectId,omitempty"`
ProjectName string `json:"projectName,omitempty"`
}

func pbAPITokenItemToAPITokenItem(p *pb.APITokenItem) *APITokenItem {
Expand All @@ -88,5 +90,13 @@ func pbAPITokenItemToAPITokenItem(p *pb.APITokenItem) *APITokenItem {
item.ExpiresAt = toTimePtr(p.ExpiresAt.AsTime())
}

if p.ProjectId != "" {
item.ProjectID = p.ProjectId
}

if p.ProjectName != "" {
item.ProjectName = p.ProjectName
}

return item
}
345 changes: 102 additions & 243 deletions app/controlplane/api/controlplane/v1/api_token.pb.go

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions app/controlplane/api/controlplane/v1/api_token.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2024 The Chainloop Authors.
// Copyright 2024-2025 The Chainloop Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,8 @@ syntax = "proto3";
package controlplane.v1;

import "buf/validate/validate.proto";
import "controlplane/v1/response_messages.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1;v1";

Expand Down Expand Up @@ -65,14 +65,3 @@ message APITokenServiceListRequest {
message APITokenServiceListResponse {
repeated APITokenItem result = 1;
}

message APITokenItem {
string id = 1;
string name = 7;
string description = 2;
string organization_id = 3;
string organization_name = 8;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp revoked_at = 5;
google.protobuf.Timestamp expires_at = 6;
}
2 changes: 1 addition & 1 deletion app/controlplane/api/controlplane/v1/api_token_grpc.pb.go

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

Loading
Loading