Validate portable workspace identifiers
This commit is contained in:
@@ -51,6 +51,9 @@ func (s *LocalStore) EnsureLayoutFor(campaign, sessionID string) (SessionPaths,
|
||||
if campaign == "" {
|
||||
return SessionPaths{}, fmt.Errorf("campaign is required")
|
||||
}
|
||||
if err := ValidateSessionIdentity(campaign, sessionID); err != nil {
|
||||
return SessionPaths{}, err
|
||||
}
|
||||
|
||||
return s.ensureLayout(s.SessionPathsFor(campaign, sessionID))
|
||||
}
|
||||
@@ -62,6 +65,9 @@ func (s *LocalStore) ensureLayout(paths SessionPaths) (SessionPaths, error) {
|
||||
if strings.TrimSpace(paths.SessionID) == "" {
|
||||
return SessionPaths{}, fmt.Errorf("sessionID is required")
|
||||
}
|
||||
if err := ValidateSessionIdentity(paths.CampaignID, paths.SessionID); err != nil {
|
||||
return SessionPaths{}, err
|
||||
}
|
||||
|
||||
dirs := []string{
|
||||
paths.Root,
|
||||
|
||||
Reference in New Issue
Block a user