-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Teleterm: add new access request fields (#39050)
- Loading branch information
Showing
13 changed files
with
1,501 additions
and
1,102 deletions.
There are no files selected for viewing
189 changes: 131 additions & 58 deletions
189
gen/proto/go/teleport/lib/teleterm/v1/access_request.pb.go
Large diffs are not rendered by default.
Oops, something went wrong.
2,101 changes: 1,089 additions & 1,012 deletions
2,101
gen/proto/go/teleport/lib/teleterm/v1/service.pb.go
Large diffs are not rendered by default.
Oops, something went wrong.
73 changes: 70 additions & 3 deletions
73
gen/proto/ts/teleport/lib/teleterm/v1/access_request_pb.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright 2024 Gravitational, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package handler | ||
|
||
import ( | ||
"time" | ||
|
||
"google.golang.org/protobuf/types/known/timestamppb" | ||
) | ||
|
||
func getProtoTimestamp(time *time.Time) *timestamppb.Timestamp { | ||
var protoTime *timestamppb.Timestamp | ||
|
||
if time != nil { | ||
protoTime = timestamppb.New(*time) | ||
} | ||
|
||
return protoTime | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright 2024 Gravitational, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package handler | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/require" | ||
"google.golang.org/protobuf/types/known/timestamppb" | ||
) | ||
|
||
func TestGetProtoTimestamp(t *testing.T) { | ||
ts := getProtoTimestamp(nil) | ||
require.Empty(t, ts) | ||
|
||
time := time.Now().UTC() | ||
ts = getProtoTimestamp(&time) | ||
require.Equal(t, timestamppb.New(time), ts) | ||
} |
Oops, something went wrong.