public id is now shown on the sessions page since authorized keys are
used which is safer.
This commit is contained in:
parent
7af575119d
commit
68804761bf
@ -80,7 +80,6 @@ func main() {
|
|||||||
state := models.State{}
|
state := models.State{}
|
||||||
agent := models.Agent{
|
agent := models.Agent{
|
||||||
PublicId: "id",
|
PublicId: "id",
|
||||||
GeneratedId: "100",
|
|
||||||
StartTime: time.Now().In(japan),
|
StartTime: time.Now().In(japan),
|
||||||
AgentInfo: comms.AgentInfo{
|
AgentInfo: comms.AgentInfo{
|
||||||
Username: "ci",
|
Username: "ci",
|
||||||
@ -94,7 +93,6 @@ func main() {
|
|||||||
state.Agents = append(state.Agents, agent)
|
state.Agents = append(state.Agents, agent)
|
||||||
client := models.Client{
|
client := models.Client{
|
||||||
PublicId: "c1",
|
PublicId: "c1",
|
||||||
AgentId: "100",
|
|
||||||
ClientId: 3,
|
ClientId: 3,
|
||||||
StartTime: time.Now().In(japan),
|
StartTime: time.Now().In(japan),
|
||||||
SessionType: "sftp",
|
SessionType: "sftp",
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
type Agent struct {
|
type Agent struct {
|
||||||
PublicId string
|
PublicId string
|
||||||
GeneratedId string
|
|
||||||
StartTime time.Time
|
StartTime time.Time
|
||||||
|
|
||||||
AgentInfo comms.AgentInfo
|
AgentInfo comms.AgentInfo
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
PublicId string
|
PublicId string
|
||||||
AgentId string
|
|
||||||
ClientId int
|
ClientId int
|
||||||
StartTime time.Time
|
StartTime time.Time
|
||||||
SessionType string
|
SessionType string
|
||||||
|
@ -34,7 +34,6 @@ func NewAgent(commChannel comms.CommChannel, publicId string, agentInfo comms.Ag
|
|||||||
return &AgentConnection{
|
return &AgentConnection{
|
||||||
Agent: models.Agent{
|
Agent: models.Agent{
|
||||||
PublicId: publicId,
|
PublicId: publicId,
|
||||||
GeneratedId: strconv.Itoa(agentIdGenerator.IncrementAndGet()),
|
|
||||||
StartTime: time.Now(),
|
StartTime: time.Now(),
|
||||||
AgentInfo: agentInfo,
|
AgentInfo: agentInfo,
|
||||||
},
|
},
|
||||||
@ -42,12 +41,11 @@ func NewAgent(commChannel comms.CommChannel, publicId string, agentInfo comms.Ag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClient(publicId string, agentId string, clientConn iowrappers2.ReadWriteAddrCloser,
|
func NewClient(publicId string, clientConn iowrappers2.ReadWriteAddrCloser,
|
||||||
agentConn net.Conn) *ClientConnection {
|
agentConn net.Conn) *ClientConnection {
|
||||||
return &ClientConnection{
|
return &ClientConnection{
|
||||||
Client: models.Client{
|
Client: models.Client{
|
||||||
PublicId: publicId,
|
PublicId: publicId,
|
||||||
AgentId: agentId,
|
|
||||||
ClientId: clientIdGenerator.IncrementAndGet(),
|
ClientId: clientIdGenerator.IncrementAndGet(),
|
||||||
StartTime: time.Now(),
|
StartTime: time.Now(),
|
||||||
},
|
},
|
||||||
@ -200,7 +198,7 @@ func (admin *Admin) addClient(publicId string, clientConn iowrappers2.ReadWriteA
|
|||||||
|
|
||||||
log.Println("Sending connection information to agent")
|
log.Println("Sending connection information to agent")
|
||||||
|
|
||||||
client := NewClient(publicId, agent.GeneratedId, clientConn, agentConn)
|
client := NewClient(publicId, clientConn, agentConn)
|
||||||
|
|
||||||
// Before using this connection for SSH we use it to send client metadata to the
|
// Before using this connection for SSH we use it to send client metadata to the
|
||||||
// agent
|
// agent
|
||||||
|
@ -34,7 +34,7 @@ templ State(state *models.State, location *time.Location) {
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>rendez-vous id</th>
|
||||||
<th>start time</th>
|
<th>start time</th>
|
||||||
<th>expiry time</th>
|
<th>expiry time</th>
|
||||||
<th>username</th>
|
<th>username</th>
|
||||||
@ -45,7 +45,7 @@ templ State(state *models.State, location *time.Location) {
|
|||||||
</thead>
|
</thead>
|
||||||
for _, agent := range state.Agents {
|
for _, agent := range state.Agents {
|
||||||
<tr>
|
<tr>
|
||||||
<td>{agent.GeneratedId}</td>
|
<td>{agent.PublicId}</td>
|
||||||
<td>{agent.StartTime.In(location).Format(time.DateTime)}</td>
|
<td>{agent.StartTime.In(location).Format(time.DateTime)}</td>
|
||||||
<td>{agent.ExpiryTime.In(location).Format(time.DateTime)}</td>
|
<td>{agent.ExpiryTime.In(location).Format(time.DateTime)}</td>
|
||||||
<td>{agent.AgentInfo.Username}</td>
|
<td>{agent.AgentInfo.Username}</td>
|
||||||
@ -67,18 +67,18 @@ templ State(state *models.State, location *time.Location) {
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>agent#</th>
|
|
||||||
<th>id</th>
|
<th>id</th>
|
||||||
<th>start time</th>
|
<th>start time</th>
|
||||||
<th>session type</th>
|
<th>session type</th>
|
||||||
|
<th>rendez-vous id</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
for _, client := range state.Clients {
|
for _, client := range state.Clients {
|
||||||
<tr>
|
<tr>
|
||||||
<td>{client.AgentId}</td>
|
|
||||||
<td>{strconv.Itoa(client.ClientId)}</td>
|
<td>{strconv.Itoa(client.ClientId)}</td>
|
||||||
<td>{client.StartTime.In(location).Format(time.DateTime)}</td>
|
<td>{client.StartTime.In(location).Format(time.DateTime)}</td>
|
||||||
<td>{client.SessionType}</td>
|
<td>{client.SessionType}</td>
|
||||||
|
<td>{client.PublicId}</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user