Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b5cb3a093
|
||
|
|
c2cde15189
|
||
|
|
b8e8621e0d
|
||
|
|
0bf24d929c
|
||
|
|
dcbc2609c4
|
||
|
|
f7baac328a |
@@ -18,14 +18,14 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.26.1'
|
go-version: '1.26.2'
|
||||||
|
|
||||||
- name: Create version
|
- name: Create version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
echo "Creating version"
|
echo "Creating version"
|
||||||
|
|
||||||
VERSION="0.2.0"
|
VERSION="0.2.1"
|
||||||
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
||||||
BRANCH_REF="${{ gitea.ref }}"
|
BRANCH_REF="${{ gitea.ref }}"
|
||||||
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: '1.26.1'
|
go-version: '1.26.2'
|
||||||
- name: Configure Git for SSH
|
- name: Configure Git for SSH
|
||||||
run: |
|
run: |
|
||||||
git config --global url."git@${{ secrets.GIT_HOST_ROOT }}:".insteadOf "https://${{ secrets.GIT_HOST_ROOT }}/"
|
git config --global url."git@${{ secrets.GIT_HOST_ROOT }}:".insteadOf "https://${{ secrets.GIT_HOST_ROOT }}/"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module git.kundeng.us/phoenix/textsender-models
|
module git.kundeng.us/phoenix/textsender-models
|
||||||
|
|
||||||
go 1.26.1
|
go 1.26.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/golang-jwt/jwt/v5 v5.3.1
|
github.com/golang-jwt/jwt/v5 v5.3.1
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package user
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
type UserProfile struct {
|
||||||
|
Usr *User `json:"user"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func InitUserProfile(usr *User) (usrProfile *UserProfile, done bool) {
|
||||||
|
if usr == nil {
|
||||||
|
return nil, false
|
||||||
|
} else {
|
||||||
|
if len(usr.Password) > 0 {
|
||||||
|
var newUsr User
|
||||||
|
newUsr = *usr
|
||||||
|
newUsr.Password = ""
|
||||||
|
usrProfile.Usr = &newUsr
|
||||||
|
|
||||||
|
return usrProfile, true
|
||||||
|
} else {
|
||||||
|
usrProfile.Usr = usr
|
||||||
|
return usrProfile, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestInitUserProfile(t *testing.T) {
|
||||||
|
usr := User{}
|
||||||
|
usr.Username = "Bob"
|
||||||
|
usr.PhoneNumber = "+12224572351"
|
||||||
|
usr.Password = "TheNight!"
|
||||||
|
profile, done := InitUserProfile(&usr)
|
||||||
|
assert.Equal(t, done, true, "Error")
|
||||||
|
assert.NotEmpty(t, profile, "UserProfile is empty")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user